Skip to content
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

Remove ABI-incompatible assertion code in any_view.hpp #1816

Merged
merged 6 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
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
7 changes: 0 additions & 7 deletions include/range/v3/view/any_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,15 @@ namespace ranges
template<typename T>
constexpr any_ref(T & obj) noexcept
: obj_(detail::addressof(obj))
#ifndef NDEBUG
, info_(&typeid(rtti_tag<T>))
#endif
{}
ericniebler marked this conversation as resolved.
Show resolved Hide resolved
template<typename T>
T & get() const noexcept
{
RANGES_ASSERT(obj_ && info_ && *info_ == typeid(rtti_tag<T>));
return *const_cast<T *>(static_cast<T const volatile *>(obj_));
}
ericniebler marked this conversation as resolved.
Show resolved Hide resolved

private:
void const volatile * obj_ = nullptr;
#ifndef NDEBUG
std::type_info const * info_ = nullptr;
#endif
};
ericniebler marked this conversation as resolved.
Show resolved Hide resolved

template<typename Base>
Expand Down
Loading