Learn R Programming

Rcpp (version 1.0.9)

demangle: c++ type information

Description

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

Usage

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

Value

The demangled type, as a string.

Arguments

type

The type we want to demangle

...

Further argument for cppFunction

Author

Romain Francois <romain@r-enthusiasts.com>

Details

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.

References

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

See Also

cppFunction is used to compile the function demangle creates.

Examples

Run this code
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