explicit_inst_small_vector_test.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2015-2015. 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/small_vector.hpp>
  11. struct empty
  12. {
  13. friend bool operator == (const empty &, const empty &){ return true; }
  14. friend bool operator < (const empty &, const empty &){ return true; }
  15. };
  16. template class ::boost::container::small_vector<empty, 2>;
  17. volatile ::boost::container::small_vector<empty, 2> dummy;
  18. #include <boost/container/allocator.hpp>
  19. #include "movable_int.hpp"
  20. #include "dummy_test_allocator.hpp"
  21. namespace boost {
  22. namespace container {
  23. template class small_vector<char, 0>;
  24. template class small_vector<char, 1>;
  25. template class small_vector<char, 2>;
  26. template class small_vector<char, 10>;
  27. template class small_vector<int, 0>;
  28. template class small_vector<int, 1>;
  29. template class small_vector<int, 2>;
  30. template class small_vector<int, 10>;
  31. //Explicit instantiation to detect compilation errors
  32. template class boost::container::small_vector
  33. < test::movable_and_copyable_int
  34. , 10
  35. , test::simple_allocator<test::movable_and_copyable_int> >;
  36. template class boost::container::small_vector
  37. < test::movable_and_copyable_int
  38. , 10
  39. , allocator<test::movable_and_copyable_int> >;
  40. }}
  41. int main()
  42. {
  43. return 0;
  44. }