Boost logo

Boost :

From: Doug Gregor (gregod_at_[hidden])
Date: 2001-04-09 07:42:48

Hello all,
        I've uploaded yet another version of any_function to the files section at:

        I would like to solicit input from those interested in any_function,
especially regarding the interface & semantics. Barring major
omissions/oversights/etc, I'll be requesting a formal review within a few

Interface summary:

  template<typename Result, typename Arg1, typename Arg2, ..., typename ArgN>
  class any_function
    any_function(const any_function&);
    template<typename Functor> any_function(Functor);

    any_function& operator=(const int); // assignment to zero clears target
    template<typename Functor> any_function& operator=(Functor);
    any_function& operator=(const any_function&);

    void clear(); // clear out the target

    bool empty() const; // true if no target
    operator const void*() const; // evaluates true if non-empty

    Result operator()(Arg1, Arg2, ..., ArgN); // call target


Boost list run by bdawes at, gregod at, cpdaniel at, john at