Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
variant-wrapper.hh File Reference
#include <variant>

Go to the source code of this file.

Macros

#define FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME)
 
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME)
 

Macro Definition Documentation

◆ FORCE_DEFAULT_CONSTRUCTORS

#define FORCE_DEFAULT_CONSTRUCTORS ( CLASS_NAME)
Value:
CLASS_NAME(const CLASS_NAME &) = default; \
CLASS_NAME(CLASS_NAME &) = default; \
CLASS_NAME(CLASS_NAME &&) = default; \
\
CLASS_NAME & operator =(const CLASS_NAME &) = default; \
CLASS_NAME & operator =(CLASS_NAME &) = default;

Force the default versions of all constructors (copy, move, copy assignment).

◆ MAKE_WRAPPER_CONSTRUCTOR

#define MAKE_WRAPPER_CONSTRUCTOR ( CLASS_NAME)
Value:
FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \
\
CLASS_NAME(auto &&... arg) \
: raw(std::forward<decltype(arg)>(arg)...) \
{ }
Raw raw
Definition lexer.l:316

Make a wrapper constructor. All args are forwarded to the construction of the "raw" field. (Which we assume is the only one.)

The moral equivalent of using Raw::Raw;