ugmisc 0.2-76
Miscellaneous C++ header library
Loading...
Searching...
No Matches
ugmisc::Features Struct Reference

#include <ugmisc/features.hpp>

Static Public Attributes

static constexpr bool constexpr_destructors = compiler and library dependent
static constexpr bool consteval_functions = compiler and library dependent
static constexpr bool consteval_if = compiler and library dependent
static constexpr bool bit_cast = compiler and library dependent
static constexpr bool bitops = compiler and library dependent
static constexpr bool constexpr_swap_algorithms = compiler and library dependent
static constexpr bool unreachable = compiler and library dependent

Detailed Description

A struct containing static constexpr bools indicating language and library features. The definition of this struct is a long list in which the corresponding macro definitions are also made.

For each of these bools, there is also a macro which is defined if true, or undefined otherwise.

Member Data Documentation

◆ bit_cast

bool ugmisc::Features::bit_cast = compiler and library dependent
staticconstexpr

std::bit_cast provides the underlying representation of one type and treats it as another type, even in a constant expression. bit_cast is true if the function is available.

See also
UGMISC_HAVE_BIT_CAST

◆ bitops

bool ugmisc::Features::bitops = compiler and library dependent
staticconstexpr

Indicates that the standard library supports bitops (countleft_zero etc).

See also
UGMISC_HAVE_BITOPS

◆ consteval_functions

bool ugmisc::Features::consteval_functions = compiler and library dependent
staticconstexpr

True if the consteval keyword is supported.

See also
UGMISC_HAVE_CONSTEVAL

◆ consteval_if

bool ugmisc::Features::consteval_if = compiler and library dependent
staticconstexpr

True if the 'consteval if' language feature is supported.

See also
UGMISC_HAVE_CONSTEVAL_IF.

◆ constexpr_destructors

bool ugmisc::Features::constexpr_destructors = compiler and library dependent
staticconstexpr

Destructors can be constexpr from C++20.

The value of this bool member is usually based only on the value of the predefined __cplusplus macro. However the macro UGMISC_HAVE_CONSTEXPR_DESTRUCTORS or UGMISC_NO_CONSTEXPR_DESTRUCTORS can be predefined to override that behaviour.

See also
UGMISC_HAVE_CONSTEXPR_DESTRUCTORS.

◆ constexpr_swap_algorithms

bool ugmisc::Features::constexpr_swap_algorithms = compiler and library dependent
staticconstexpr

swap, exchange etc are constexpr.

See also
UGMISC_HAVE_CONSTEXPR_SWAP_ALGORITHMS

◆ unreachable

bool ugmisc::Features::unreachable = compiler and library dependent
staticconstexpr

true if std::unreachable() exists.

See also
UGMISC_HAVE_UNREACHABLE

The documentation for this struct was generated from the following file: