[[Rcpp::register]]
| 126 | |
| 127 | // [[Rcpp::register]] |
| 128 | std::string demangle(const std::string& name) { |
| 129 | #ifdef RCPP_HAS_DEMANGLING |
| 130 | std::string real_class; |
| 131 | int status =-1; |
| 132 | char *dem = 0; |
| 133 | dem = abi::__cxa_demangle(name.c_str(), 0, 0, &status); |
| 134 | if (status == 0) { |
| 135 | real_class = dem; |
| 136 | free(dem); |
| 137 | } else { |
| 138 | real_class = name; |
| 139 | } |
| 140 | return real_class; |
| 141 | #else |
| 142 | return name; |
| 143 | #endif |
| 144 | } |
| 145 | |
| 146 | // NOTE: remains registered but this routine is now effectively unused by Rcpp; |
| 147 | // we retain it for backwards compatibility with any existing packages which |
no outgoing calls
no test coverage detected