Namespaces
Variants

std::meta::is_namespace

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and queries
Type properties
Type property queries
 
Defined in header <meta>
consteval bool is_namespace( std::meta::info r );
(since C++26)

Returns true if r represents an entity whose underlying entity is a namespace. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents a namespace; otherwise false.

Example

#include <meta>

static_assert(is_namespace(^^std));
static_assert(!is_namespace(^^int));

int main() {}

See also

checks if reflection represents a namespace alias
(function) [edit]
checks if reflection represents a namespace member
(function) [edit]
returns a reflection of the enclosing namespace
(function) [edit]