demangle: c++ type information

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

demangle gives the demangled type, sizeof its size (in bytes).

Usage

1
2
    demangle(type = "int", ...)
    sizeof(type = "int", ...)

Arguments

type

The type we want to demangle

...

Further argument for cppFunction

Details

The following function is compiled and invoked:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
        SEXP demangle_this_type(){
            typedef 
            return wrap( DEMANGLE(type) ) ;
        }
        
        SEXP sizeof_this_type(){
            typedef 
            return wrap( sizeof(type) ) ;
        }
    

DEMANGLE is a macro in Rcpp that does the work.

Value

The demangled type, as a string.

Note

We only know how to demangle with gcc. If you know how to demangle types with your compiler, let us know.

Author(s)

Romain Francois <romain@r-enthusiasts.com>

References

See this chapter from the GNU C++ library manual.

See Also

cppFunction is used to compile the function demangle creates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
    demangle( "int64_t" )
    demangle( "uint64_t" )

    demangle( "NumericVector" )
    demangle( "std::map<std::string,double>" )
    
    sizeof( "long" )
    sizeof( "long long" )
    

## End(Not run)

Rcpp documentation built on May 2, 2019, 5:23 p.m.