
16 Mar
2006
16 Mar
'06
2:29 p.m.
On Mar 13, 2006, at 10:40 AM, Howard Hinnant wrote:
"is_movable" is an overly vague name for what you're attempting to detect.
Given a type T, a non-initialized x, and an initialized y, here is the sequence of statements you're optimizing.
::new(&x) T(move(y)); y.~T();
The better name finally occurred to me this morning. If the above were to be proposed for the C++ language, here is the syntax I would expect: y.~T(&x); I.e. this is a "move destructor". The compiler could even safely auto-generate it using the move-construct-destruct sequence. Anyway, therefore the name I recommend is: has_trivial_move_destructor. -Howard