X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibc%2B%2B.so_src%2Finclude_exp%2Fallocator;h=1608a3c72ed36f273230782e84a58104be4c1a3b;hb=145dd00e5c5a36f844be327e16a00b2983245423;hp=656507f6d50111db8b308cfb3ee125a1a12b123c;hpb=c55ececc6533d5e1e72adea971219bf701960336;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc++.so_src/include_exp/allocator b/Usermode/Libraries/libc++.so_src/include_exp/allocator index 656507f6..1608a3c7 100644 --- a/Usermode/Libraries/libc++.so_src/include_exp/allocator +++ b/Usermode/Libraries/libc++.so_src/include_exp/allocator @@ -8,12 +8,20 @@ #ifndef _LIBCXX_ALLOCATOR_ #define _LIBCXX_ALLOCATOR_ +#include "_libcxx_helpers.h" + #include "new" #include "cstddef" +#include "utility" namespace std { -template class allocator +template class allocator; + +namespace _bits { + +template +class allocator_real { public: typedef T value_type; @@ -30,14 +38,14 @@ public: typedef allocator other; }; - allocator() throw() { + allocator_real() throw() { } - allocator(const allocator& alloc __attribute__((unused))) throw() { + allocator_real(const allocator_real& alloc __attribute__((unused))) throw() { } template - allocator(const allocator& alloc) throw() { + allocator_real(const allocator_real& alloc) throw() { } - ~allocator() throw() { + ~allocator_real() throw() { } pointer address(reference x) const { @@ -61,15 +69,50 @@ public: new ((void*)p) value_type (val); } // C++11 - //template - //void construct( U* p, Args&&... args ) { - // ::new ((void*)p) U (forward(args)); - //} + #if _CXX11_AVAIL + template + void construct( U* p, Args&&... args ) { + ::new ((void*)p) U (::std::forward(args)...); + } + #endif void destroy(pointer p) { p->~value_type(); } }; +template +class allocator_noconstruct: + public ::std::_bits::allocator_real +{ +public: + void construct( typename allocator_real::pointer p, typename allocator_real::const_reference val ) { + *p = val; + } + void destroy(typename allocator_real::pointer p) { + } +}; + +}; + +template +class allocator: + public _bits::allocator_real +{ +}; + +#if 1 +template <> +class allocator: + public _bits::allocator_noconstruct +{ +}; +template <> +class allocator: + public _bits::allocator_noconstruct +{ +}; +#endif + }; #endif