std::meta::access_context::unchecked - cppreference.com
From cppreference.com
static consteval std::meta::access_context unchecked() noexcept; |
||
Returns a new access_context with no associated scope, and whose designating class is the null reflection.
When the result is passed to a standard reflection function such as std::meta::is_accessible, no access check is performed. All members are considered accessible.
Return value
An access_context with no associated scope.
Notes
If an unchecked access_context has a designating class, the class is still checked when determining if a member is accessible.
constexpr auto ctx = std::meta::access_context::unchecked(); struct A {}; struct B { int x; }; // Cannot use A to name B::x static_assert(!std::meta::is_accessible(^^B::x, ctx.via(^^A)));
Example
See also
constructs a std::meta::access_context associated with the scope of the call site (public static member function) [edit] | |
constructs a std::meta::access_context associated with the scope of the global namespace (public static member function) [edit] |