|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-09-22 17:57:07
I notice that any_pointer doesn't contain a member function pointer among
its union fields. I take it that means that member functions /always/ go
through conversion to a function object when stored inside a
boost::function instance... presumably to prevent all function objects from
growing just so they can support virtual functions. Correct?
Now, the docs say:
a.. A function object f of type F is stateless if it is a function pointer
or if boost::is_stateless<T> is true. The construction of or copy to a
Boost.Function object from a stateless function object will not cause
exceptions to be thrown and will not allocate any storage.
So I look in the table for is_stateless, and it's labelled "PC" meaning it
requires direct compiler support and partial specialization. There are a
whole bunch like that. I'm baffled by that combination! If it requires
direct compiler support, then you sure don't need partial specialization,
because the compiler can "just make it work". Maybe this means that given
some other trait that requires direct support, plus partial specialization,
we can implement is_stateless ourselves?
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk