Except when interacting with boost, use std::function and std::bind

when C++11 is available. See: http://stackoverflow.com/questions/14617835
This commit is contained in:
JoelKatz
2013-03-16 03:27:43 -07:00
parent 606dff758c
commit b9456c8fd7
17 changed files with 60 additions and 48 deletions

View File

@@ -289,13 +289,28 @@ bool parseUrl(const std::string& strUrl, std::string& strScheme, std::string& st
#if (!defined(FORCE_NO_C11X) && (__cplusplus > 201100L)) || defined(FORCE_C11X)
#define C11X
#define UPTR_T std::unique_ptr
#define MOVE_P(p) std::move(p)
#include <functional>
#define UPTR_T std::unique_ptr
#define MOVE_P(p) std::move(p)
#define BIND_TYPE std::bind
#define FUNCTION_TYPE std::function
#define P_1 std::placeholders::_1
#define P_2 std::placeholders::_2
#define P_3 std::placeholders::_3
#define P_4 std::placeholders::_4
#else
#define UPTR_T std::auto_ptr
#define MOVE_P(p) (p)
#include <boost/bind.hpp>
#include <boost/function.hpp>
#define UPTR_T std::auto_ptr
#define MOVE_P(p) (p)
#define BIND_TYPE boost::bind
#define FUNCTION_TYPE boost::function
#define P_1 _1
#define P_2 _2
#define P_3 _3
#define P_4 _4
#endif