pmr_string_test.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031
  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/pmr/string.hpp>
  11. #include <boost/static_assert.hpp>
  12. #include <boost/container/detail/type_traits.hpp>
  13. int main()
  14. {
  15. using namespace boost::container;
  16. using boost::container::dtl::is_same;
  17. typedef basic_string<char, std::char_traits<char>, pmr::polymorphic_allocator<char> > string_t;
  18. typedef basic_string<wchar_t, std::char_traits<wchar_t>, pmr::polymorphic_allocator<wchar_t> > wstring_t;
  19. BOOST_STATIC_ASSERT(( is_same<string_t, pmr::string>::value ));
  20. BOOST_STATIC_ASSERT(( is_same<string_t, pmr::basic_string_of<char>::type>::value ));
  21. BOOST_STATIC_ASSERT(( is_same<wstring_t, pmr::wstring>::value ));
  22. BOOST_STATIC_ASSERT(( is_same<wstring_t, pmr::basic_string_of<wchar_t>::type>::value ));
  23. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  24. BOOST_STATIC_ASSERT(( is_same<string_t, pmr::string >::value ));
  25. BOOST_STATIC_ASSERT(( is_same<wstring_t, pmr::wstring >::value ));
  26. #endif
  27. return 0;
  28. }