[functional/forward]howto do Abraham's new_ attached to review post

I've been trying, unsuccessfully, to use the forward library to do what the template<class T> inline std::auto_ptr<T> new_ (/*variadic number args passed to T CTOR/*) function shown in the attachment to: http://lists.boost.org/Archives/boost/2007/12/131251.php However, so far all I've got is shown in the attachment. But that's not what, AFAICT, Abraham's new_does. Could someone show me how to do Abraham's new with functional/forward?

On 12/12/07 09:46, Larry Evans wrote:
I've been trying, unsuccessfully, to use the forward library to do what the
template<class T> inline std::auto_ptr<T> new_ (/*variadic number args passed to T CTOR/*)
function shown in the attachment to:
http://lists.boost.org/Archives/boost/2007/12/131251.php
However, so far all I've got is shown in the attachment. But that's not what, AFAICT, Abraham's new_does.
Could someone show me how to do Abraham's new with functional/forward?
OK, I spoke too soon. The new attachment shows: new_<T>()(arg1,arg2,...,argN) IOW, the new_<T>() creates the boost::forward_adapter which is then invoked with the (arg1,arg2,...,argN). Is this the way to do it ( where 'it' is use functional/forward to emulate Abraham's new_)?

On 12/12/07 10:42, Larry Evans wrote:
On 12/12/07 09:46, Larry Evans wrote:
I've been trying, unsuccessfully, to use the forward library to do what the
template<class T> inline std::auto_ptr<T> new_ (/*variadic number args passed to T CTOR/*)
function shown in the attachment to:
[snip]
Could someone show me how to do Abraham's new with functional/forward?
OK, I spoke too soon. The new attachment shows:
new_<T>()(arg1,arg2,...,argN)
[snip] The new functional/factory is probably the way to go. The attachment shows a slight modification (addition of factory_fwd template) of the libs/functional/factory/test/factory.cpp file to demonstrate the idea. I just should have been more patient and waited for functional/factory :(
participants (1)
-
Larry Evans