mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-25 21:35:41 +00:00
fix testspr
This commit is contained in:
parent
7784046f95
commit
64e1994734
2 changed files with 29 additions and 16 deletions
|
@ -162,7 +162,7 @@ namespace testspr {
|
|||
return func_ == nullptr ? rhs == nullptr
|
||||
: rhs == nullptr ? false
|
||||
: func_.target_type() == rhs.target_type()
|
||||
&& func_.target<bool (testspr::trace_stack const&)>() == rhs.target<bool (testspr::trace_stack const&)>()
|
||||
&& func_.target<bool (*)(testspr::trace_stack const&)>() == rhs.target<bool (*)(testspr::trace_stack const&)>()
|
||||
;
|
||||
}
|
||||
SPROUT_NON_CONSTEXPR bool operator!=(function_type const& rhs) const {
|
||||
|
|
|
@ -39,10 +39,10 @@ namespace testspr {
|
|||
};
|
||||
|
||||
//
|
||||
// typename_of
|
||||
// demangle
|
||||
//
|
||||
namespace detail {
|
||||
#ifdef TESTSPR_HAS_CXXABI_H
|
||||
namespace detail {
|
||||
inline SPROUT_NON_CONSTEXPR char*
|
||||
demangle_alloc(char const* name) {
|
||||
int status = 0;
|
||||
|
@ -66,27 +66,40 @@ namespace testspr {
|
|||
return demangled_;
|
||||
}
|
||||
};
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
demangle(char const* name) {
|
||||
scoped_demangled_name demangled(name);
|
||||
return demangled.get() ? demangled.get() : name;
|
||||
}
|
||||
#else
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
demangle(char const* name) {
|
||||
return name;
|
||||
}
|
||||
#endif
|
||||
} // namespace detail
|
||||
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
demangle(char const* name) {
|
||||
testspr::detail::scoped_demangled_name demangled(name);
|
||||
return demangled.get() ? demangled.get() : name;
|
||||
}
|
||||
#else
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
demangle(char const* name) {
|
||||
return name;
|
||||
}
|
||||
#endif
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
demangle(std::string const& name) {
|
||||
return testspr::demangle(name.c_str());
|
||||
}
|
||||
|
||||
//
|
||||
// typename_of
|
||||
//
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
typename_of(std::type_info const& t) {
|
||||
return testspr::demangle(t.name());
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
typename_of() {
|
||||
return testspr::detail::demangle(typeid(T).name());
|
||||
return testspr::typename_of(typeid(T));
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_NON_CONSTEXPR std::string
|
||||
typename_of(T&& t) {
|
||||
return testspr::detail::demangle(typeid(std::forward<T>(t)).name());
|
||||
return testspr::typename_of(typeid(std::forward<T>(t)));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue