mbo::all_of_t< _Tfunc, _Ty > Struct Template Reference

all_of function adapter More...

#include <for_all.h>

Inheritance diagram for mbo::all_of_t< _Tfunc, _Ty >:

Inheritance graph
{std::unary_function\<_Ty, bool\>\n||}
[legend]
Collaboration diagram for mbo::all_of_t< _Tfunc, _Ty >:

Collaboration graph
{std::unary_function\<_Ty, bool\>\n||}
[legend]

List of all members.

Public Types

typedef _Tfunc func_t

Public Member Functions

 all_of_t (func_t func)
result_type operator() (argument_type arg)
 operator bool ()

Protected Attributes

bool m_res
func_t m_func


Detailed Description

template<typename _Tfunc, typename _Ty>
struct mbo::all_of_t< _Tfunc, _Ty >

all_of function adapter

Definition at line 319 of file for_all.h.


Member Typedef Documentation

template<typename _Tfunc, typename _Ty>
typedef _Tfunc mbo::all_of_t< _Tfunc, _Ty >::func_t

Definition at line 323 of file for_all.h.


Constructor & Destructor Documentation

template<typename _Tfunc, typename _Ty>
mbo::all_of_t< _Tfunc, _Ty >::all_of_t ( func_t  func  )  [inline]

Definition at line 325 of file for_all.h.

00326         : m_func(func)
00327         , m_res(true)
00328     {
00329     }


Member Function Documentation

template<typename _Tfunc, typename _Ty>
result_type mbo::all_of_t< _Tfunc, _Ty >::operator() ( argument_type  arg  )  [inline]

Definition at line 331 of file for_all.h.

References mbo::all_of_t< _Tfunc, _Ty >::m_func, and mbo::all_of_t< _Tfunc, _Ty >::m_res.

00332     {
00333         // Cannot use &= because compiler might generate code that 
00334         // optimizes out remaining calls after first fail.
00335         if (!(m_func(arg)))
00336         {
00337             m_res = false;
00338         }
00339         return m_res;
00340     }

template<typename _Tfunc, typename _Ty>
mbo::all_of_t< _Tfunc, _Ty >::operator bool (  )  [inline]

Definition at line 342 of file for_all.h.

References mbo::all_of_t< _Tfunc, _Ty >::m_res.

00343     {
00344         return m_res;
00345     }


Member Data Documentation

template<typename _Tfunc, typename _Ty>
bool mbo::all_of_t< _Tfunc, _Ty >::m_res [protected]

Definition at line 349 of file for_all.h.

Referenced by mbo::all_of_t< _Tfunc, _Ty >::operator bool(), and mbo::all_of_t< _Tfunc, _Ty >::operator()().

template<typename _Tfunc, typename _Ty>
func_t mbo::all_of_t< _Tfunc, _Ty >::m_func [protected]

Definition at line 350 of file for_all.h.

Referenced by mbo::all_of_t< _Tfunc, _Ty >::operator()().


The documentation for this struct was generated from the following file:
  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:10 2008 for MBO-lib by doxygen 1.5.4