Patchwork [v3] Implement pointer_traits and allocator_traits

login
register
mail settings
Submitter Jonathan Wakely
Date May 28, 2011, 7:16 p.m.
Message ID <BANLkTike2R4ZZ5udrqYoWSz5MmqSEvn8zQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/97818/
State New
Headers show

Comments

Jonathan Wakely - May 28, 2011, 7:16 p.m.
On 28 May 2011 20:08, Jonathan Wakely wrote:
> On 28 May 2011 18:14, Jonathan Wakely wrote:
>> One more test
>>
>> 2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>
>>
>>        * testsuite/20_util/pointer_traits/pointer_to.cc: New.
>>
>> Tested x86_64-linux, committed to trunk.
>>
>
> This new test is failing, I'm looking into why, will revert it if necessary ...
>

2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * testsuite/20_util/pointer_traits/pointer_to.cc: Fix.

I added the pointer_traits<Ptr> case at the last minute and it was
broken, not sure how I didn't notice - I must have tested in the wrong
directory.  This fixes it, definitely tested this time, sorry for the
mess!

Patch

Index: testsuite/20_util/pointer_traits/pointer_to.cc
===================================================================
--- testsuite/20_util/pointer_traits/pointer_to.cc	(revision 174381)
+++ testsuite/20_util/pointer_traits/pointer_to.cc	(working copy)
@@ -24,15 +24,17 @@ 
 struct Ptr
 {
   typedef bool element_type;
+  bool* value;
 
-  static bool* pointer_to(bool& b) { return 0; }
+  static Ptr pointer_to(bool& b) { return Ptr{&b}; }
 };
 
 void test01()
 {
   bool test = true;
+  Ptr p{&test};
 
-  VERIFY( std::pointer_traits<Ptr>::pointer_to(test) == 0 );
+  VERIFY( std::pointer_traits<Ptr>::pointer_to(test).value == &test );
 }
 
 void test02()