std::meta::is_noexcept
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
|
(C++26) | checks if reflection represents a function (function) |
|
(C++11) | checks if a type is a function type (class template) |
|
(C++26) | checks if reflected type is a function type (function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_noexcept