Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
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 (const JBool< __first__ > &first, const JBool< __second__ > &second)
 Make logical SWITCH.
 

Static Public Attributes

static const bool value = __value__
 Value.
 
template<bool __first__, bool __second__>
static JBool<(value &&__first__)||(!value &&__second__) c_switch )()
 Make logical SWITCH.
 

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__>
typedef 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 }

◆ 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 {
71 return JBool<value == option>();
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 {
84 return bool_type::c_equals<option>();
85 }

◆ 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 {
96 return JBool<value && option>();
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 {
109 return bool_type::c_and<option>();
110 }

◆ 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 {
134 return bool_type::c_or<option>();
135 }

◆ 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 {
159 return bool_type::c_xor<option>();
160 }

◆ c_switch()

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 {
188 return bool_type::c_switch<__first__, __second__>();
189 }

Member Data Documentation

◆ value

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

Value.

Definition at line 38 of file JBool.hh.

◆ c_switch

template<bool __value__>
template<bool __first__, bool __second__>
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.

Returns
logical SWITCH

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

Parameters
firstfirst value
secondsecond value
Returns
logical SWITCH

Definition at line 170 of file JBool.hh.

171 {
172 return JBool<(value && __first__) || (!value && __second__)>();
173 }

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