////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2004-2019. 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 #include #include #include #include "map_test.hpp" #include using namespace boost::container; template struct GetMapContainer { template struct apply { typedef std::pair type_t; typedef flat_map< ValueType , ValueType , std::less , typename boost::container::dtl::container_or_allocator_rebind::type > map_type; typedef flat_multimap< ValueType , ValueType , std::less , typename boost::container::dtl::container_or_allocator_rebind::type > multimap_type; }; }; int main() { using namespace boost::container::test; //////////////////////////////////// // Testing sequence container implementations //////////////////////////////////// { typedef std::map MyStdMap; typedef std::multimap MyStdMultiMap; if (0 != test::map_test < GetMapContainer > >::apply::map_type , MyStdMap , GetMapContainer > >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test > >" << std::endl; return 1; } if (0 != test::map_test < GetMapContainer, 7> >::apply::map_type , MyStdMap , GetMapContainer, 7> >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test, 7> >" << std::endl; return 1; } if (0 != test::map_test < GetMapContainer, MaxElem * 10> >::apply::map_type , MyStdMap , GetMapContainer, MaxElem * 10> >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test, MaxElem * 10> >" << std::endl; return 1; } if (0 != test::map_test < GetMapContainer > >::apply::map_type , MyStdMap , GetMapContainer > >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test > >" << std::endl; return 1; } if (0 != test::map_test < GetMapContainer > >::apply::map_type , MyStdMap , GetMapContainer > >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test > >" << std::endl; return 1; } if (0 != test::map_test < GetMapContainer > >::apply::map_type , MyStdMap , GetMapContainer > >::apply::multimap_type , MyStdMultiMap>()) { std::cout << "Error in map_test > >" << std::endl; return 1; } } { using namespace boost::container; using boost::container::dtl::is_same; typedef flat_map, small_vector, 10> > map_container_t; typedef flat_multimap, small_vector, 10> > multimap_container_t; #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) BOOST_STATIC_ASSERT(( is_same >::value )); BOOST_STATIC_ASSERT(( is_same >::value )); #endif BOOST_STATIC_ASSERT(( is_same::type >::value )); BOOST_STATIC_ASSERT(( is_same::type >::value )); } return 0; }