
29 Jan
2007
29 Jan
'07
6:27 p.m.
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?