
17 May
2012
17 May
'12
3:26 p.m.
On 17 May 2012 03:33, Klaim - Joël Lamotte <mjklaim@gmail.com> wrote: Third, I want to use boost::any in a value-semantic type. Sometime it would
keep a unique_ptr. If I understand correctly move semantic and unique_ptr implementation, the current boost::any implementation don't forbid me to use unique_ptr as a value type.
It currently forbids you because Copyable is a requirement on the value type, and is enforced in boost::any::holder<ValueType>::clone. If you want to hold a move only type, you'll have to have a version of detect it and throw an exception when copying is attempted. -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404