boost_no_cxx11_inline_namespaces.ipp 684 B

123456789101112131415161718192021222324252627282930
  1. // (C) Copyright Andrey Semashev 2013
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_INLINE_NAMESPACES
  7. // TITLE: C++11 inline namespaces.
  8. // DESCRIPTION: The compiler does not support C++11 inline namespaces.
  9. namespace boost_no_cxx11_inline_namespaces {
  10. inline namespace my_ns {
  11. int data = 0;
  12. } // namespace my_ns
  13. int test()
  14. {
  15. data = 1;
  16. if (&data == &my_ns::data)
  17. return 0;
  18. else
  19. return 1;
  20. }
  21. }