Re: Potential problem in Builder: invalid object copy
Status: Alpha
Brought to you by:
madduck
|
From: martin f k. <ma...@ma...> - 2004-06-01 12:17:47
|
also sprach stephan beal <st...@s1...> [2004.06.01.1242 +0200]: > Builder<AType,BType> bob; >=20 > CType c; > AType * a =3D bob.build( c ); >=20 > Doh! Undefined copy behaviour! a compile time error, right? > 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. yeah, that's fine. if you try to do things with the library that you should not, two things can happen: (a) a compiler error (b) a runtime error (b) should be avoided at all cost. (a) should be promoted. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: kra...@ai... mad...@ma... =20 (on the statement print "42 monkeys"+"1 snake") btw, both perl and python get this wrong. perl gives 43 and python gives "42 monkeys1 snake", when the answer is clearly "41 monkeys and 1 fat snake". -- jim fulton |