Changeset 44467


Ignore:
Timestamp:
Apr 16, 2008, 5:35:56 PM (11 years ago)
Author:
Daniel James
Message:

Add C++-0x support to the test allocators.

Location:
branches/unordered/trunk/libs/unordered/test/objects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/unordered/trunk/libs/unordered/test/objects/exception.hpp

    r43844 r44467  
    348348        }
    349349
     350#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
     351        template<class... Args> void construct(pointer p, Args&&... args) {
     352            UNORDERED_SCOPE(allocator::construct(pointer, Args&&...)) {
     353                UNORDERED_EPOINT("Mock allocator construct function.");
     354                new(p) T(std::forward<Args>(args)...);
     355            }
     356            detail::tracker.track_construct((void*) p, sizeof(T), tag_);
     357        }
     358#endif
     359
    350360        void destroy(pointer p) {
    351361            detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
  • branches/unordered/trunk/libs/unordered/test/objects/minimal.hpp

    r43844 r44467  
    2525    class default_copy_constructible;
    2626    class assignable;
     27
    2728    template <class T> class hash;
    2829    template <class T> class equal_to;
     
    208209
    209210        void construct(pointer p, T const& t) { new((void*)p.ptr_) T(t); }
     211
     212#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
     213        template<class... Args> void construct(pointer p, Args&&... args) {
     214            new((void*)p.ptr_) T(std::forward<Args>(args)...);
     215        }
     216#endif
     217
    210218        void destroy(pointer p) { ((T*)p.ptr_)->~T(); }
    211219
  • branches/unordered/trunk/libs/unordered/test/objects/test.hpp

    r43844 r44467  
    213213        }
    214214
     215#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
     216        template<class... Args> void construct(pointer p, Args&&... args) {
     217            detail::tracker.track_construct((void*) p, sizeof(T), tag_);
     218            new(p) T(std::forward<Args>(args)...);
     219        }
     220#endif
     221
    215222        void destroy(pointer p) {
    216223            detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
Note: See TracChangeset for help on using the changeset viewer.