STK++ 0.9.13
STK::hidden::AnyVisitor< Type_ > Struct Template Reference

Visitor checking if at least, one element of an array is different from zero. More...

#include <STK_Visitors.h>

Public Types

typedef bool Type
 
typedef bool constTypeConst
 

Public Member Functions

 AnyVisitor ()
 
void operator() (Type_ const &value, int i, int j)
 
void operator() (Type_ const &value, int i)
 
TypeConst result () const
 

Public Attributes

bool res_
 

Detailed Description

template<typename Type_>
struct STK::hidden::AnyVisitor< Type_ >

Visitor checking if at least, one element of an array is different from zero.

For example:

// check if one of the elements of A is equal to 2

bool f = (A == 2).any()

See also
ExprBase::all()

Definition at line 339 of file STK_Visitors.h.

Member Typedef Documentation

◆ Type

template<typename Type_ >
typedef bool STK::hidden::AnyVisitor< Type_ >::Type

Definition at line 342 of file STK_Visitors.h.

◆ TypeConst

template<typename Type_ >
typedef bool const& STK::hidden::AnyVisitor< Type_ >::TypeConst

Definition at line 343 of file STK_Visitors.h.

Constructor & Destructor Documentation

◆ AnyVisitor()

template<typename Type_ >
STK::hidden::AnyVisitor< Type_ >::AnyVisitor ( )
inline

Definition at line 344 of file STK_Visitors.h.

344: res_(false) {}

Member Function Documentation

◆ operator()() [1/2]

template<typename Type_ >
void STK::hidden::AnyVisitor< Type_ >::operator() ( Type_ const value,
int  i 
)
inline

Definition at line 346 of file STK_Visitors.h.

346{ res_ |= (value);}

References STK::hidden::AnyVisitor< Type_ >::res_.

◆ operator()() [2/2]

template<typename Type_ >
void STK::hidden::AnyVisitor< Type_ >::operator() ( Type_ const value,
int  i,
int  j 
)
inline

Definition at line 345 of file STK_Visitors.h.

345{ res_ |= (value);}

References STK::hidden::AnyVisitor< Type_ >::res_.

◆ result()

template<typename Type_ >
TypeConst STK::hidden::AnyVisitor< Type_ >::result ( ) const
inline

Definition at line 347 of file STK_Visitors.h.

347{ return res_;}

References STK::hidden::AnyVisitor< Type_ >::res_.

Member Data Documentation

◆ res_


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