Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JBool< __value__ > Struct Template Reference

Auxiliary template class for type bool. More...

#include <JBool.hh>

Public Types

typedef JBool< __value__ > bool_type
 Type definition of bool value.
 

Public Member Functions

 JBool ()
 Default construcor.
 
 operator bool () const
 Type conversion operator.
 

Static Public Member Functions

static JBool<!valuec_not ()
 Make logical NOT.
 
template<bool option>
static JBool< value==option > c_equals ()
 Make logical EQUALS.
 
template<bool option>
static JBool< value==option > c_equals (const JBool< option > &object)
 Make logical EQUALS.
 
template<bool option>
static JBool< value &&option > c_and ()
 Make logical AND.
 
template<bool option>
static JBool< value &&option > c_and (const JBool< option > &object)
 Make logical AND.
 
template<bool option>
static JBool< value||option > c_or ()
 Make logical OR.
 
template<bool option>
static JBool< value||option > c_or (const JBool< option > &object)
 Make logical OR.
 
template<bool option>
static JBool< value !=option > c_xor ()
 Make logical XOR.
 
template<bool option>
static JBool< value !=option > c_xor (const JBool< option > &object)
 Make logical XOR.
 
template<bool __first__, bool __second__>
static JBool<(value &&__first__)||(!value &&__second__)> c_switch ()
 Make logical SWITCH.
 
template<bool __first__, bool __second__>
static JBool<(value &&__first__)||(!value &&__second__)> c_switch (const JBool< __first__ > &first, const JBool< __second__ > &second)
 Make logical SWITCH.
 

Static Public Attributes

static const bool value = __value__
 Value.
 

Detailed Description

template<bool __value__>
struct JLANG::JBool< __value__ >

Auxiliary template class for type bool.

This class can be used for boolean expressions at compile time.

Definition at line 20 of file JBool.hh.

Member Typedef Documentation

◆ bool_type

template<bool __value__>
JBool<__value__> JLANG::JBool< __value__ >::bool_type

Type definition of bool value.

Definition at line 25 of file JBool.hh.

Constructor & Destructor Documentation

◆ JBool()

template<bool __value__>
JLANG::JBool< __value__ >::JBool ( )
inline

Default construcor.

Definition at line 31 of file JBool.hh.

32 {}

Member Function Documentation

◆ operator bool()

template<bool __value__>
JLANG::JBool< __value__ >::operator bool ( ) const
inline

Type conversion operator.

Returns
value

Definition at line 46 of file JBool.hh.

47 {
48 return value;
49 }
static const bool value
Value.
Definition JBool.hh:38

◆ c_not()

template<bool __value__>
static JBool<!value > JLANG::JBool< __value__ >::c_not ( )
inlinestatic

Make logical NOT.

Returns
logical NOT

Definition at line 57 of file JBool.hh.

58 {
59 return JBool<!value>();
60 }
JBool()
Default construcor.
Definition JBool.hh:31

◆ c_equals() [1/2]

template<bool __value__>
template<bool option>
static JBool< value==option > JLANG::JBool< __value__ >::c_equals ( )
inlinestatic

Make logical EQUALS.

Returns
logical EQUALS

Definition at line 69 of file JBool.hh.

70 {
72 }

◆ c_equals() [2/2]

template<bool __value__>
template<bool option>
static JBool< value==option > JLANG::JBool< __value__ >::c_equals ( const JBool< option > & object)
inlinestatic

Make logical EQUALS.

Parameters
objectvalue
Returns
logical EQUALS

Definition at line 82 of file JBool.hh.

83 {
85 }
static JBool< value==option > c_equals()
Make logical EQUALS.
Definition JBool.hh:69

◆ c_and() [1/2]

template<bool __value__>
template<bool option>
static JBool< value &&option > JLANG::JBool< __value__ >::c_and ( )
inlinestatic

Make logical AND.

Returns
logical AND

Definition at line 94 of file JBool.hh.

95 {
97 }

◆ c_and() [2/2]

template<bool __value__>
template<bool option>
static JBool< value &&option > JLANG::JBool< __value__ >::c_and ( const JBool< option > & object)
inlinestatic

Make logical AND.

Parameters
objectvalue
Returns
logical AND

Definition at line 107 of file JBool.hh.

108 {
110 }
static JBool< value &&option > c_and()
Make logical AND.
Definition JBool.hh:94

◆ c_or() [1/2]

template<bool __value__>
template<bool option>
static JBool< value||option > JLANG::JBool< __value__ >::c_or ( )
inlinestatic

Make logical OR.

Returns
logical OR

Definition at line 119 of file JBool.hh.

120 {
121 return JBool<value || option>();
122 }

◆ c_or() [2/2]

template<bool __value__>
template<bool option>
static JBool< value||option > JLANG::JBool< __value__ >::c_or ( const JBool< option > & object)
inlinestatic

Make logical OR.

Parameters
objectvalue
Returns
logical OR

Definition at line 132 of file JBool.hh.

133 {
135 }
static JBool< value||option > c_or()
Make logical OR.
Definition JBool.hh:119

◆ c_xor() [1/2]

template<bool __value__>
template<bool option>
static JBool< value !=option > JLANG::JBool< __value__ >::c_xor ( )
inlinestatic

Make logical XOR.

Returns
logical XOR

Definition at line 144 of file JBool.hh.

145 {
146 return JBool<value != option>();
147 }

◆ c_xor() [2/2]

template<bool __value__>
template<bool option>
static JBool< value !=option > JLANG::JBool< __value__ >::c_xor ( const JBool< option > & object)
inlinestatic

Make logical XOR.

Parameters
objectvalue
Returns
logical XOR

Definition at line 157 of file JBool.hh.

158 {
160 }
static JBool< value !=option > c_xor()
Make logical XOR.
Definition JBool.hh:144

◆ c_switch() [1/2]

template<bool __value__>
template<bool __first__, bool __second__>
static JBool<(value &&__first__)||(!value &&__second__)> JLANG::JBool< __value__ >::c_switch ( )
inlinestatic

Make logical SWITCH.

If value is true, select first, else select second.

Returns
logical SWITCH

Definition at line 170 of file JBool.hh.

◆ c_switch() [2/2]

template<bool __value__>
template<bool __first__, bool __second__>
static JBool<(value &&__first__)||(!value &&__second__)> JLANG::JBool< __value__ >::c_switch ( const JBool< __first__ > & first,
const JBool< __second__ > & second )
inlinestatic

Make logical SWITCH.

If value is true, select first, else select second.

Parameters
firstfirst value
secondsecond value
Returns
logical SWITCH

Definition at line 185 of file JBool.hh.

187 {
189 }
static JBool<(value &&__first__)||(!value &&__second__)> c_switch()
Make logical SWITCH.
Definition JBool.hh:170

Member Data Documentation

◆ value

template<bool __value__>
const bool JLANG::JBool< __value__ >::value = __value__
static

Value.

Definition at line 38 of file JBool.hh.


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