1 ////////////////////////////////////////////////////////////////////////////// 2 // 3 // (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/libs/container for documentation. 8 // 9 ////////////////////////////////////////////////////////////////////////////// 10 #include <boost/container/deque.hpp> 11 #include <boost/container/allocator.hpp> 12 #include <boost/core/lightweight_test.hpp> 13 14 using namespace boost::container; 15 test_block_bytes()16void test_block_bytes() 17 { 18 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) 19 using options_t = deque_options_t< block_bytes<128u> >; 20 #else 21 typedef deque_options< block_bytes<128u> >::type options_t; 22 #endif 23 typedef deque<unsigned short, void, options_t> deque_t; 24 BOOST_TEST(deque_t::get_block_size() == 128u/sizeof(unsigned short)); 25 } 26 test_block_elements()27void test_block_elements() 28 { 29 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) 30 using options_t = deque_options_t< block_size<64> >; 31 #else 32 typedef deque_options< block_size<64 > >::type options_t; 33 #endif 34 typedef deque<unsigned char, void, options_t> deque_t; 35 BOOST_TEST(deque_t::get_block_size() == 64U); 36 } 37 main()38int main() 39 { 40 test_block_bytes(); 41 test_block_elements(); 42 return ::boost::report_errors(); 43 } 44