Potential problem in Builder: invalid object copy
Status: Alpha
Brought to you by:
madduck
|
From: stephan b. <st...@s1...> - 2004-06-01 10:42:01
|
inline _BaseType*
build(_BaseType const& __THAT) const {...}
Let's say i've got:
Builder<AType,BType> bob;
CType c;
AType * a = bob.build( c );
Doh! Undefined copy behaviour!
Also, it just occurred to me: all of the copy-based funcs are of course
going to require that the type be Copyable, which may not be the case
for some types. Many types which are default-constructable are not
copyable. zB, singletons come to mind. It is also possible that BaseT
implements Copyable but SubT does not, in which case such a call would
fail... luckily, at compile time.
--
----- st...@s1... http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts
|