//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class scoped_allocator_adaptor // outer_allocator_type& outer_allocator(); // const outer_allocator_type& outer_allocator() const; #include #include #include "allocators.h" int main() { #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::scoped_allocator_adaptor> A; A a(A1(5)); assert(a.outer_allocator() == A1(5)); } { typedef std::scoped_allocator_adaptor, A2> A; A a(A1(5), A2(6)); assert(a.outer_allocator() == A1(5)); } { typedef std::scoped_allocator_adaptor, A2, A3> A; A a(A1(5), A2(6), A3(8)); assert(a.outer_allocator() == A1(5)); } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES }