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

any_of function adapter More...

#include <for_all.h>

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

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

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

List of all members.

Public Types

typedef _Tfunc func_t

Public Member Functions

 any_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 _Ty, typename _Tfunc>
struct mbo::any_of_t< _Ty, _Tfunc >

any_of function adapter

Definition at line 364 of file for_all.h.


Member Typedef Documentation

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

Definition at line 368 of file for_all.h.


Constructor & Destructor Documentation

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

Definition at line 370 of file for_all.h.

00371         : m_func(func)
00372         , m_res(false)
00373     {
00374     }


Member Function Documentation

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

Definition at line 376 of file for_all.h.

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

00377     {
00378         // Cannot use |= because compiler might generate code that 
00379         // optimizes out remaining calls after first sucess.
00380         if (m_func(arg))
00381         {
00382             m_res = true;
00383         }
00384         return m_res;
00385     }

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

Definition at line 387 of file for_all.h.

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

00388     {
00389         return m_res;
00390     }


Member Data Documentation

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

Definition at line 394 of file for_all.h.

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

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

Definition at line 395 of file for_all.h.

Referenced by mbo::any_of_t< _Ty, _Tfunc >::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