//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03 // // template // class scoped_allocator_adaptor // scoped_allocator_adaptor(); #include #include #include "test_macros.h" #include "allocators.h" int main(int, char**) { { 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); } return 0; }