Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
cpp14_inline.hpp File Reference

Go to the source code of this file.

Macro Definition Documentation

◆ ARENE_CPP14_INLINE_VARIABLE_INIT

#define ARENE_CPP14_INLINE_VARIABLE_INIT ( name,
... )
Value:
namespace ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_NS(name) { /* NOLINT(google-build-namespaces) */ \
template <decltype(nullptr) = nullptr> /* NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) */ \
extern constexpr auto ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_VAR(name) = __VA_ARGS__; \
} \
ARENE_MAYBE_UNUSED static constexpr auto const& name = \
ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_NS(name)::ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_VAR(name)<>; \
#define ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_VAR(name)
Definition cpp14_inline.hpp:93
#define ARENE_MAYBE_UNUSED
An alias for [[maybe_unused]] , or a no-op if the attribute is not supported.
Definition maybe_unused.hpp:25
#define ARENE_REQUIRE_SEMICOLON
Definition require_semicolon.hpp:15

Emulates C++17's inline variable declarations for an arbitrary initializer expression.

Parameters
nameThe name the instantiated object should have in the containing namespace.
...The initializer expression. Variadic so that initializers containing commas (e.g. template arguments of the constructed type) do not need extra parentheses at the call site.

Companion to ARENE_CPP14_INLINE_VARIABLE for cases where the value cannot be produced by default-construction (e.g. function objects returned from arene::base::bind_back ).

◆ ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_NS

#define ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_NS ( name)
Value:
name##_cpp14_inline_detail

◆ ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_VAR

#define ARENE_CPP14_INLINE_VARIABLE_INIT_DETAIL_VAR ( name)
Value:
name##_v