////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2011-2013. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// #include #include #include #include "propagation_test_allocator.hpp" struct not_uses_allocator {}; struct uses_allocator_and_not_convertible_to_int { typedef uses_allocator_and_not_convertible_to_int allocator_type; }; struct uses_allocator_and_convertible_to_int { typedef char allocator_type; }; struct uses_erased_type_allocator { typedef boost::container::erased_type allocator_type; }; int main() { using namespace boost::container; //Using dummy classes BOOST_STATIC_ASSERT(( false == uses_allocator < not_uses_allocator, int>::value )); BOOST_STATIC_ASSERT(( false == uses_allocator < uses_allocator_and_not_convertible_to_int, int>::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < uses_allocator_and_convertible_to_int, int>::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < uses_erased_type_allocator, int>::value )); //Using an allocator-like class BOOST_STATIC_ASSERT(( false == uses_allocator < allocator_argument_tester , propagation_test_allocator >::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < allocator_argument_tester , propagation_test_allocator >::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < allocator_argument_tester , propagation_test_allocator >::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < allocator_argument_tester , propagation_test_allocator >::value )); BOOST_STATIC_ASSERT(( true == uses_allocator < allocator_argument_tester , propagation_test_allocator >::value )); BOOST_STATIC_ASSERT(( true == constructible_with_allocator_prefix < allocator_argument_tester >::value )); BOOST_STATIC_ASSERT(( true == constructible_with_allocator_suffix < allocator_argument_tester >::value )); BOOST_STATIC_ASSERT(( true == constructible_with_allocator_prefix < allocator_argument_tester >::value )); BOOST_STATIC_ASSERT(( true == constructible_with_allocator_suffix < allocator_argument_tester >::value )); return 0; }