powered by
demangle gives the demangled type, sizeof its size (in bytes).
demangle
sizeof
demangle(type = "int", ...) sizeof(type = "int", ...)
The demangled type, as a string.
The type we want to demangle
Further argument for cppFunction
cppFunction
Romain Francois <romain@r-enthusiasts.com>
The following function is compiled and invoked:
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.
DEMANGLE
See this chapter from the GNU C++ library manual.
cppFunction is used to compile the function demangle creates.
if (FALSE) { demangle( "int64_t" ) demangle( "uint64_t" ) demangle( "NumericVector" ) demangle( "std::map" ) sizeof( "long" ) sizeof( "long long" ) }
Run the code above in your browser using DataLab