I use the following code to get the class name:
template <typename T>
string GetName(const T& object) {
using type = typename remove_const<typename remove_reference<decltype(object)>::type>::type;
return boost::typeindex::type_id_with_cvr<type>().pretty_name();
}
The code works well. However, the returned string also contains namespaces. Is there a boost function that returns only the class name? I know that I could write it myself, it's not about reinventing the wheel.
source
share