explicit_inst_flat_set_test.cpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/flat_set.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::flat_set<empty>;
  17. template class ::boost::container::flat_multiset<empty>;
  18. volatile ::boost::container::flat_set<empty> dummy;
  19. volatile ::boost::container::flat_multiset<empty> dummy2;
  20. #include <boost/container/allocator.hpp>
  21. #include "movable_int.hpp"
  22. #include "dummy_test_allocator.hpp"
  23. #include <boost/container/stable_vector.hpp>
  24. #include <boost/container/small_vector.hpp>
  25. #include <boost/container/deque.hpp>
  26. #include <boost/container/static_vector.hpp>
  27. namespace boost {
  28. namespace container {
  29. //Explicit instantiation to detect compilation errors
  30. //flat_set
  31. template class flat_set
  32. < test::movable_and_copyable_int
  33. , std::less<test::movable_and_copyable_int>
  34. , small_vector<test::movable_and_copyable_int, 10, allocator<test::movable_and_copyable_int> >
  35. >;
  36. //flat_multiset
  37. template class flat_multiset
  38. < test::movable_and_copyable_int
  39. , std::less<test::movable_and_copyable_int>
  40. , stable_vector<test::movable_and_copyable_int, test::simple_allocator<test::movable_and_copyable_int> >
  41. >;
  42. template class flat_multiset
  43. < test::movable_and_copyable_int
  44. , std::less<test::movable_and_copyable_int>
  45. , deque<test::movable_and_copyable_int, test::simple_allocator< test::movable_and_copyable_int > >
  46. >;
  47. template class flat_multiset
  48. < test::movable_and_copyable_int
  49. , std::less<test::movable_and_copyable_int>
  50. , static_vector<test::movable_and_copyable_int, 10 >
  51. >;
  52. //As flat container iterators are typedefs for vector::[const_]iterator,
  53. //no need to explicit instantiate them
  54. }} //boost::container
  55. #if (__cplusplus > 201103L)
  56. #include <vector>
  57. namespace boost{
  58. namespace container{
  59. template class flat_set
  60. < test::movable_and_copyable_int
  61. , std::less<test::movable_and_copyable_int>
  62. , std::vector<test::movable_and_copyable_int>
  63. >;
  64. }} //boost::container
  65. #endif
  66. int main()
  67. {
  68. return 0;
  69. }