Patchwork [v3] improve allocator_traits test

login
register
mail settings
Submitter Jonathan Wakely
Date June 11, 2011, 3:37 p.m.
Message ID <BANLkTikdFGhK=1W4-ThDnV3X7jX-+=b7gw@mail.gmail.com>
Download mbox | patch
Permalink /patch/100015/
State New
Headers show

Comments

Jonathan Wakely - June 11, 2011, 3:37 p.m.
2011-06-11  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * testsuite/20_util/allocator_traits/requirements/
        explicit_instantiation.cc: Add another instantiation.

Tested x86_64-linux, committed to trunk.

Patch

Index: testsuite/20_util/allocator_traits/requirements/explicit_instantiation.cc
===================================================================
--- testsuite/20_util/allocator_traits/requirements/explicit_instantiation.cc	(revision 174931)
+++ testsuite/20_util/allocator_traits/requirements/explicit_instantiation.cc	(working copy)
@@ -22,8 +22,21 @@ 
 
 #include <memory>
 
+typedef short test_type;
+
+template<typename T>
+  struct minimal_allocator
+  {
+    typedef T value_type;
+    minimal_allocator();
+    template <typename U>
+      minimal_allocator(const minimal_allocator<U>&);
+    T* allocate(std::size_t);
+    void deallocate(T*, std::size_t);
+  };
+
 namespace std
 {
-  typedef short test_type;
   template struct allocator_traits<std::allocator<test_type>>;
+  template struct allocator_traits<minimal_allocator<test_type>>;
 }