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