Namespaces
Variants

std::meta::is_noexcept

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

Returns true if r represents a noexcept function type or a function with a non-throwing exception specification. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents a noexcept function type or function; otherwise false.

Notes

If r does not represent a function type or function, the result is false. In particular, the result is false if r represents a function template.

Example

#include <meta>

template<bool Cond>
void f() noexcept(Cond);

static_assert(std::meta::is_noexcept(^^f<true>));
static_assert(!std::meta::is_noexcept(^^f<false>));
static_assert(!std::meta::is_noexcept(^^f));

using fty = decltype(f<true>);
static_assert(std::meta::is_noexcept(^^fty));

int main() {}

See also

Template:cpp/meta/dsc is function type
checks if reflection represents a function
(function) [edit]
checks if a type is a function type
(class template) [edit]