boost_no_cxx11_non_pub_def_fun.ipp 1003 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright Andrey Semashev 2014
  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_NON_PUBLIC_DEFAULTED_FUNCTIONS
  7. // TITLE: C++11 non-public defaulted functions unavailable
  8. // DESCRIPTION: The compiler does not support C++11 defaulted functions in access control sections other than public
  9. #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X)
  10. # error Non-public defaulted functions are not supported in non-C++11 mode
  11. #endif
  12. namespace boost_no_cxx11_non_public_defaulted_functions {
  13. struct foo
  14. {
  15. protected:
  16. foo() = default;
  17. foo& operator= (foo const&) = default;
  18. };
  19. struct bar
  20. {
  21. private:
  22. bar() = default;
  23. bar& operator= (bar const&) = default;
  24. };
  25. int test()
  26. {
  27. return 0;
  28. }
  29. }