////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2004-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 #include #include "movable_int.hpp" #include "dummy_test_allocator.hpp" using namespace boost::container; typedef std::pair pair_t; namespace boost { namespace container { //Explicit instantiation to detect compilation errors namespace dtl { //Instantiate base class as previous instantiations don't instantiate inherited members template class tree < pair_t , select1st , std::less , test::simple_allocator , tree_assoc_defaults >; template class tree < pair_t , select1st , std::less , std::allocator , tree_assoc_defaults >; template class tree < pair_t , select1st , std::less , adaptive_pool , tree_assoc_defaults >; template class tree < test::movable_and_copyable_int , identity , std::less , test::simple_allocator , tree_assoc_defaults >; template class tree < test::movable_and_copyable_int , identity , std::less , std::allocator , tree_assoc_defaults >; template class tree < test::movable_and_copyable_int , identity , std::less , adaptive_pool , tree_assoc_defaults >; } //dtl { }} //boost::container int main () { //////////////////////////////////// // has_trivial_destructor_after_move testing //////////////////////////////////// // default { typedef boost::container::dtl::tree, void, void> tree; typedef tree::allocator_type allocator_type; typedef boost::container::allocator_traits::pointer pointer; typedef tree::key_compare key_compare; if (boost::has_trivial_destructor_after_move::value != boost::has_trivial_destructor_after_move::value && boost::has_trivial_destructor_after_move::value && boost::has_trivial_destructor_after_move::value) { std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl; return 1; } } // std::allocator { typedef boost::container::dtl::tree, std::allocator, void> tree; typedef tree::allocator_type allocator_type; typedef boost::container::allocator_traits::pointer pointer; typedef tree::key_compare key_compare; if (boost::has_trivial_destructor_after_move::value != boost::has_trivial_destructor_after_move::value && boost::has_trivial_destructor_after_move::value && boost::has_trivial_destructor_after_move::value) { std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl; return 1; } } return 0; }