boost_no_cxx17_fold_expressions.ipp 564 B

123456789101112131415161718192021222324252627
  1. /*
  2. Copyright 2017 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. // MACRO: BOOST_NO_CXX17_FOLD_EXPRESSIONS
  9. // TITLE: C++17 fold expressions
  10. // DESCRIPTION: C++17 fold expressions are not supported.
  11. namespace boost_no_cxx17_fold_expressions {
  12. template<class... Args>
  13. auto sum(Args&&... args)
  14. {
  15. return (args + ... + 0);
  16. }
  17. int test()
  18. {
  19. return sum(1, -1, 1, 1, -1, -1);
  20. }
  21. } /* boost_no_cxx17_fold_expressions */