boost_no_cxx14_member_init.ipp 646 B

123456789101112131415161718192021222324252627282930
  1. // (C) Copyright Kohei Takahashi 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_CXX14_AGGREGATE_NSDMI
  7. // TITLE: C++14 member initializers unavailable
  8. // DESCRIPTION: The compiler does not support C++14 member initializers
  9. namespace boost_no_cxx14_aggregate_nsdmi
  10. {
  11. struct S
  12. {
  13. int x;
  14. int y = 0;
  15. };
  16. int test()
  17. {
  18. S s[] = { { 0x72 }, { 0x42 } };
  19. return s[1].x - 0x42;
  20. }
  21. }