]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
json_spirit: avoid using bind placeholders in global namespace
authorKefu Chai <kchai@redhat.com>
Fri, 26 Jun 2020 14:26:40 +0000 (22:26 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 26 Jun 2020 14:43:03 +0000 (22:43 +0800)
to silence the warning from boost v1.73, like

json_spirit/json_spirit_reader.cpp:7:
/opt/ceph/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> +
using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/json_spirit/json_spirit_reader_template.h

index 2d0b3a440e61714daeb60f476697833446af5fbb..7d394b26e7d3d838291d7e0332a10864d2b81857 100644 (file)
@@ -17,7 +17,7 @@
 \r
 #define BOOST_SPIRIT_THREADSAFE  // uncomment for multithreaded use, requires linking to boost.thread\r
 \r
-#include <boost/bind.hpp>\r
+#include <boost/bind/bind.hpp>\r
 #include <boost/function.hpp>\r
 #include <boost/version.hpp>\r
 \r
@@ -211,6 +211,8 @@ namespace json_spirit
         return get_str( tmp.begin(), tmp.end() );\r
     }\r
 \r
+    using namespace boost::placeholders;\r
+\r
     // this class's methods get called by the spirit parse resulting\r
     // in the creation of a JSON object or array\r
     //\r