//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class scoped_allocator_adaptor // scoped_allocator_adaptor(); #include #include #include "../allocators.h" int main() { #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::scoped_allocator_adaptor> A; A a; assert(a.outer_allocator() == A1()); assert(a.inner_allocator() == a); assert(A1::copy_called == false); assert(A1::move_called == false); } { typedef std::scoped_allocator_adaptor, A2> A; A a; assert(a.outer_allocator() == A1()); assert(a.inner_allocator() == std::scoped_allocator_adaptor>()); assert(A1::copy_called == false); assert(A1::move_called == false); assert(A2::copy_called == false); assert(A2::move_called == false); } { typedef std::scoped_allocator_adaptor, A2, A3> A; A a; assert(a.outer_allocator() == A1()); assert((a.inner_allocator() == std::scoped_allocator_adaptor, A3>())); assert(A1::copy_called == false); assert(A1::move_called == false); assert(A2::copy_called == false); assert(A2::move_called == false); assert(A3::copy_called == false); assert(A3::move_called == false); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES }