Skip to content

Commit 356b6c4

Browse files
authored
cpp2util.h: Fix typeid(T) -> Typeid<T> usage with -fno-rtti. (#219)
1 parent 1269838 commit 356b6c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/cpp2util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ auto Typeid() -> decltype(auto) {
443443

444444
// We don't need typeid(expr) yet -- uncomment this if/when we need it
445445
//auto Typeid( [[maybe_unused]] auto&& x ) -> decltype(auto) {
446-
//#ifdef CPP2_DISABLE_RTTI
446+
//#ifdef CPP2_NO_RTTI
447447
// Type.expects(
448448
// !"<write appropriate error message here>"
449449
// );
@@ -1144,7 +1144,7 @@ auto as( std::variant<Ts...> const& x ) -> decltype(auto) {
11441144
template<typename T, typename X>
11451145
requires (std::is_same_v<X,std::any> && !std::is_same_v<T,std::any> && !std::is_same_v<T,empty>)
11461146
constexpr auto is( X const& x ) -> bool
1147-
{ return x.type() == typeid(T); }
1147+
{ return x.type() == Typeid<T>(); }
11481148

11491149
template<typename T, typename X>
11501150
requires (std::is_same_v<X,std::any> && std::is_same_v<T,empty>)

0 commit comments

Comments
 (0)