Revision | 5247 (tree) |
---|---|
Zeit | 2017-10-11 16:41:17 |
Autor | bolero-murakami |
(empty log message)
@@ -162,7 +162,7 @@ | ||
162 | 162 | return func_ == nullptr ? rhs == nullptr |
163 | 163 | : rhs == nullptr ? false |
164 | 164 | : func_.target_type() == rhs.target_type() |
165 | - && func_.target<bool (testspr::trace_stack const&)>() == rhs.target<bool (testspr::trace_stack const&)>() | |
165 | + && func_.target<bool (*)(testspr::trace_stack const&)>() == rhs.target<bool (*)(testspr::trace_stack const&)>() | |
166 | 166 | ; |
167 | 167 | } |
168 | 168 | SPROUT_NON_CONSTEXPR bool operator!=(function_type const& rhs) const { |
@@ -39,10 +39,10 @@ | ||
39 | 39 | }; |
40 | 40 | |
41 | 41 | // |
42 | - // typename_of | |
42 | + // demangle | |
43 | 43 | // |
44 | +#ifdef TESTSPR_HAS_CXXABI_H | |
44 | 45 | namespace detail { |
45 | -#ifdef TESTSPR_HAS_CXXABI_H | |
46 | 46 | inline SPROUT_NON_CONSTEXPR char* |
47 | 47 | demangle_alloc(char const* name) { |
48 | 48 | int status = 0; |
@@ -66,21 +66,30 @@ | ||
66 | 66 | return demangled_; |
67 | 67 | } |
68 | 68 | }; |
69 | - inline SPROUT_NON_CONSTEXPR std::string | |
70 | - demangle(char const* name) { | |
71 | - scoped_demangled_name demangled(name); | |
72 | - return demangled.get() ? demangled.get() : name; | |
73 | - } | |
69 | + } // namespace detail | |
70 | + | |
71 | + inline SPROUT_NON_CONSTEXPR std::string | |
72 | + demangle(char const* name) { | |
73 | + testspr::detail::scoped_demangled_name demangled(name); | |
74 | + return demangled.get() ? demangled.get() : name; | |
75 | + } | |
74 | 76 | #else |
75 | - inline SPROUT_NON_CONSTEXPR std::string | |
76 | - demangle(char const* name) { | |
77 | - return name; | |
78 | - } | |
77 | + inline SPROUT_NON_CONSTEXPR std::string | |
78 | + demangle(char const* name) { | |
79 | + return name; | |
80 | + } | |
79 | 81 | #endif |
80 | - } // namespace detail | |
81 | 82 | inline SPROUT_NON_CONSTEXPR std::string |
83 | + demangle(std::string const& name) { | |
84 | + return testspr::demangle(name.c_str()); | |
85 | + } | |
86 | + | |
87 | + // | |
88 | + // typename_of | |
89 | + // | |
90 | + inline SPROUT_NON_CONSTEXPR std::string | |
82 | 91 | typename_of(std::type_info const& t) { |
83 | - return testspr::detail::demangle(t.name()); | |
92 | + return testspr::demangle(t.name()); | |
84 | 93 | } |
85 | 94 | template<typename T> |
86 | 95 | inline SPROUT_NON_CONSTEXPR std::string |