Skip to content

Commit

Permalink
typeinfo: add pretty_name to std::type_index
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent committed Sep 3, 2024
1 parent 2a9b3b5 commit 42b309f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/type_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ void exposeStdTypeIndex() {
"Returns an implementation defined null-terminated character string "
"containing the name of the type. No guarantees are given; in "
"particular, the returned string can be identical for several types "
"and change between invocations of the same program.");
"and change between invocations of the same program.")
.def(
"pretty_name",
+[](const Self &value) -> std::string {
return boost::core::demangle(value.name());
},
bp::arg("self"), "Human readible name.");
}

void exposeBoostTypeIndex() {
Expand Down

0 comments on commit 42b309f

Please sign in to comment.