boost_no_cxx11_addressof.ipp 743 B

12345678910111213141516171819202122232425262728
  1. // (C) Copyright John Maddock 2012
  2. // (C) Copyright Peter Dimov 2014
  3. // Use, modification and distribution are subject to the
  4. // Boost 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. // See http://www.boost.org/libs/config for more information.
  7. // MACRO: BOOST_NO_CXX11_ADDRESSOF
  8. // TITLE: C++11 <memory> doesn't have a working std::addressof
  9. // DESCRIPTION: The compiler does not support the function std::addressof added to <memory>
  10. #include <memory>
  11. namespace boost_no_cxx11_addressof {
  12. void x3()
  13. {
  14. }
  15. int test()
  16. {
  17. int x1, x2[3];
  18. return std::addressof(x1) != &x1 || std::addressof(x2) != &x2 || std::addressof(x3) != &x3;
  19. }
  20. }