The Battle for Wesnoth  1.15.7+dev
functional.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12  */
13 
14 /*
15  * Wrapper header to allow use of placeholder variables without a namespace.
16  */
17 
18 #pragma once
19 
20 #include <functional>
21 
22 #if BOOST_VERSION >= 107300
23 using namespace std::placeholders;
24 #else
25 #include <boost/bind.hpp>
26 
27 // We'd like to just say "using namespace std::placeholders", but unfortunately
28 // that clashes with Boost.Bind's placeholders in some cases (even if bind.hpp is not included).
29 // Instead, we specialize std::is_placeholder for the Boost placeholders,
30 // so that Boost placeholders can be passed to std::bind.
31 
32 namespace std
33 { // Some compilers can't handle it being specialized in the global scope
34 template<int N>
35 struct is_placeholder<boost::arg<N>> : public integral_constant<int, N>
36 {
37 };
38 } // namespace std
39 #endif
STL namespace.