From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-04 07:59:34
I think that if we add another template parameter to boost::function,
Storage, with requirements that (1) sizeof(Storage) >= sizeof(void*), (2) an
object of type Storage always has the correct alignment for every type T
such that sizeof(T) <= sizeof(Storage), then (a) the implementation of
boost::function could be simplified, and (b) it will provide nothrow
guarantees for function objects smaller than Storage.
The default Storage would be something similar to max_align_t, i.e.
void * pv;
void (*pf) ();
void (A::*pmf) ();
// bind(&A::f, this)
void (A::*pmf2) ();
A * p2;
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk