boost_no_cxx14_decltype_auto.ipp 682 B

123456789101112131415161718192021222324252627282930313233
  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_DECLTYPE_AUTO
  7. // TITLE: C++14 decltype(auto) unavailable
  8. // DESCRIPTION: The compiler does not support C++14 decltype(auto)
  9. namespace boost_no_cxx14_decltype_auto
  10. {
  11. void quiet_warning(int){}
  12. const int &foo(const int &x)
  13. {
  14. return x;
  15. }
  16. int test()
  17. {
  18. int j;
  19. decltype(auto) x = foo(j);
  20. quiet_warning(x);
  21. return 0;
  22. }
  23. }