Skip to content

cpp2util.h: Fix typeid(T) -> Typeid<T> usage with -fno-rtti. #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/cpp2util.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ auto Typeid() -> decltype(auto) {

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

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