boost.png (6897 bytes) Home Libraries People FAQ More

PrevUpHomeNext

Class template functionN

boost::functionN — A set of generalized function pointers that can be used for callbacks or wrapping function objects.

Synopsis

template<typename R, typename T1, typename T2, ..., typename TN, 
         typename Allocator = std::allocator<void> > 
class functionN : public function_base {
public:
  // types
  typedef R         result_type;         
  typedef Allocator allocator_type;      
  typedef T1        argument_type;         // If N == 1
  typedef T1        first_argument_type;   // If N == 2
  typedef T2        second_argument_type;  // If N == 2
  typedef T1        arg1_type;           
  typedef T2        arg2_type;           
     .
     .
     .
  typedef TN        argN_type;           

  // static constants
  static const int arity = N;

  // Lambda library support
  template<typename Args> 
  struct sig {
    // types
    typedef result_type type;
  };

  // construct/copy/destruct
  functionN();
  functionN(const functionN&);
  template<typename F> functionN(F);
  functionN& operator=(const functionN&);
  ~functionN();

  // modifiers
  void swap(const functionN&);
  void clear();

  // capacity
  bool empty() const;
  operator safe_bool() const;
  bool operator!() const;

  // target access
  template<typename Functor> Functor* target();
  template<typename Functor> const Functor* target() const;
  template<typename Functor> bool contains(const Functor&) const;

  // invocation
  result_type operator()(arg1_type, arg2_type, ..., argN_type) const;
};

// specialized algorithms
template<typename T1, typename T2, ..., typename TN, typename Allocator> 
  void swap(functionN<T1, T2, ..., TN, Allocator>&, 
            functionN<T1, T2, ..., TN, Allocator>&);

// comparison operators
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator==(const functionN<T1, T2, ..., TN, Allocator>&, Functor);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator==(Functor, const functionN<T1, T2, ..., TN, Allocator>&);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator==(const functionN<T1, T2, ..., TN, Allocator>&, 
                  reference_wrapper<Functor>);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator==(reference_wrapper<Functor>, 
                  const functionN<T1, T2, ..., TN, Allocator>&);
template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
         typename U1, typename U2, ..., typename UN, typename Allocator2> 
  void operator==(const functionN<T1, T2, ..., TN, Allocator1>&, 
                  const functionN<U1, U2, ..., UN, Allocator2>&);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, 
                  reference_wrapper<Functor>);
template<typename T1, typename T2, ..., typename TN, typename Allocator, 
         typename Functor> 
  bool operator!=(reference_wrapper<Functor>, 
                  const functionN<T1, T2, ..., TN, Allocator>&);
template<typename T1, typename T2, ..., typename TN, typename Allocator1, 
         typename U1, typename U2, ..., typename UN, typename Allocator2> 
  void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&, 
                  const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Functor, const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&,                   reference_wrapper<Functor>); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(reference_wrapper<Functor>,                   const functionN<T1, T2, ..., TN, Allocator>&); template<typename T1, typename T2, ..., typename TN, typename Allocator1,          typename U1, typename U2, ..., typename UN, typename Allocator2>   void operator!=(const functionN<T1, T2, ..., TN, Allocator1>&,                   const functionN<U1, U2, ..., UN, Allocator2>&);

Description

Class template functionN is actually a fambold">typename Allocator,          typename Functor>   bool operator!=(const functionN<T1, T2, ..., TN, Allocator>&, Functor); template<typename T1, typename T2, ..., typename TN, typename Allocator,          typename Functor>   bool operator!=(Func