|
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:
http://groups.yahoo.com/group/boost/files/Callback/any_function-04-08.zip
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
days.
------------------------------
Interface summary:
template<typename Result, typename Arg1, typename Arg2, ..., typename ArgN>
class any_function
{
any_function();
any_function(const any_function&);
template<typename Functor> any_function(Functor);
~any_function();
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
};
-------------------------------
Doug
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk