stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: svn commit: r675044 - in /stdcxx/branches/4.3.x: include/rw/_tuple.h include/tuple tests/utilities/20.tuple.cnstr.cpp tests/utilities/20.tuple.creation.cpp tests/utilities/20.tuple.h tests/utilities/20.tuple.helpers.cpp
Date Wed, 09 Jul 2008 18:27:37 GMT
 

Eric Lemings wrote:
>
>> Travis Vitek wrote:
>>
>> >Modified: 
>stdcxx/branches/4.3.x/tests/utilities/20.tuple.creation.cpp
>...
>> >+    rw_assert (0 == std::strcmp (s, "string"), __FILE__, __LINE__,
>> >+               "s == \"string\", got false, expected true");
>> 
>> The tuple is holding the original pointer (not a copy), so I 
>think you
>> can check the actual pointer here.
>
>True.  But if that assumption became invalid for whatever reason, the
>code above would still work.
>
>Assumptions are bad.  Robustness is good.  :)

As I see it, the tuple implementation is required to hold a copy of an
object of the specified type (const char* in this case). If you don't
verify the value held is indeed a copy, you are not actually verifying
the requirements. This is wrong, and wrong is much worse than bad. :)

>
>Brad.
>

Mime
View raw message