Boost logo

Boost :

From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2007-01-29 13:27:18


Steven Watanabe wrote:

> I don't think it would be a good idea to require this
> True, move functions should not throw, but they
> might not even exist. You could define a trait
> template<class T> struct has_nothrow_move;
> defaulting to boost::has_nothrow_copy<T>
> and create the object on the heap when this returns false.

The problem is that in my case the type is only known through an
abstract class inherited by a templated one on the type.
So asking whether the type has a nothrow move or copy will incur a
virtual function call.

Do you think it is a good idea to query the type or should I let the
user choose explicitly what configuration to use?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk