boost_no_cxx11_pointer_traits.ipp 787 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. Copyright 2017 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. // MACRO: BOOST_NO_CXX11_POINTER_TRAITS
  9. // TITLE: C++11 <memory> lacks a correct std::pointer_traits
  10. // DESCRIPTION: The standard library lacks a working std::pointer_traits.
  11. #include <memory>
  12. namespace boost_no_cxx11_pointer_traits {
  13. template<class T>
  14. struct pointer {
  15. template<class U>
  16. using rebind = pointer<U>;
  17. };
  18. template<class T>
  19. struct result { };
  20. template<>
  21. struct result<pointer<bool> > {
  22. static const int value = 0;
  23. };
  24. int test()
  25. {
  26. return result<std::pointer_traits<pointer<int> >::rebind<bool> >::value;
  27. }
  28. } /* boost_no_cxx11_pointer_traits */