]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
1 | /*============================================================================= |
2 | Copyright (c) 2017 Daniel James | |
3 | ||
4 | Use, modification and distribution is subject to the Boost Software | |
5 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
6 | http://www.boost.org/LICENSE_1_0.txt) | |
7 | =============================================================================*/ | |
8 | ||
9 | // Macro for C++11 range based for loop, with BOOST_FOREACH as a fallback. | |
10 | // Can't use C++11 loop in Visual C++ 10/Visual Studio 2010 or gcc 4.4. | |
11 | // BOOST_FOREACH was causing warnings in Visual C++ 14.11/Visual Studio 2017 | |
12 | ||
13 | #if !defined(BOOST_QUICKBOOK_FOR_HPP) | |
14 | #define BOOST_QUICKBOOK_FOR_HPP | |
15 | ||
16 | #include <boost/config.hpp> | |
17 | ||
18 | #if !defined(BOOST_NO_CXX11_RANGE_BASED_FOR) | |
19 | #define QUICKBOOK_FOR(x, y) for (x : y) | |
20 | #else | |
21 | #include <boost/foreach.hpp> | |
22 | #define QUICKBOOK_FOR(x, y) BOOST_FOREACH (x, y) | |
23 | #endif | |
24 | ||
25 | #endif |