SyTen
syten::YesNo< T > Struct Template Reference

A base template for all sorts of typefull boolean flags, to be used more in the future. More...

#include <toggle_enums.h>

+ Inheritance diagram for syten::YesNo< T >:

Public Member Functions

 operator bool () const
 implicit convertible More...
 
YesNooperator= (YesNo &&)=default
 Defaulted move assignment op. More...
 
YesNooperator= (YesNo const &)=default
 Defaulted copy assignment op. More...
 
 YesNo ()=default
 Defaulted standard ctor. More...
 
 YesNo (int v)
 Default ctor. More...
 
 YesNo (YesNo &&)=default
 Defaulted move ctor. More...
 
 YesNo (YesNo const &)=default
 Defaulted copy ctor. More...
 

Static Public Member Functions

static YesNo n ()
 factor for 'false' flags More...
 
static YesNo y ()
 factory for 'true' flags More...
 

Public Attributes

bool value
 storage More...
 

Detailed Description

template<typename T>
struct syten::YesNo< T >

A base template for all sorts of typefull boolean flags, to be used more in the future.

Create your own flag with using YourFlag = YesNo<struct _yourflag>; and then use either the static functions y() and n() or construction by passing a boolean to construct objects.

The advantage over plain bool flags is that you don't need to worry about argument order, the advantage over enums is that this is implicitly convertible to bool.


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