diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c09298e66..99611cd523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ different versioning scheme, following the Haskell community's declare members other than non-static data members, member enumerations, or member classes. ([Issue #1027](https://github.com/microsoft/bond/issues/1027)) +* Fixed Boost 1.73 warning "The practice of declaring the Bind placeholders + (_1, _2, ...) in the global namespace is deprecated." ([Pull request + #1036](https://github.com/microsoft/bond/pull/1036)) ### C# ### diff --git a/cpp/inc/bond/core/schema.h b/cpp/inc/bond/core/schema.h index 4b03f8897e..5a14133d49 100644 --- a/cpp/inc/bond/core/schema.h +++ b/cpp/inc/bond/core/schema.h @@ -10,7 +10,7 @@ #include "reflection.h" #include "runtime_schema.h" -#include +#include #include #include diff --git a/cpp/test/compat/core/serialization.cpp b/cpp/test/compat/core/serialization.cpp index 5b6ce4b894..b3395cc0e4 100644 --- a/cpp/test/compat/core/serialization.cpp +++ b/cpp/test/compat/core/serialization.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -231,7 +231,7 @@ void Init(Test test, Compat& obj) // Erase field m_defaults fields.erase( - std::remove_if(fields.begin(), fields.end(), boost::bind(FieldIdEqual(), Compat::Schema::var::m_defaults::id, _1)), + std::remove_if(fields.begin(), fields.end(), boost::bind(FieldIdEqual(), Compat::Schema::var::m_defaults::id, boost::placeholders::_1)), fields.end()); { diff --git a/cpp/test/core/apply_tests.cpp b/cpp/test/core/apply_tests.cpp index 0f768992ef..17e0966aac 100644 --- a/cpp/test/core/apply_tests.cpp +++ b/cpp/test/core/apply_tests.cpp @@ -24,7 +24,7 @@ void Marshal(uint16_t version = bond::v1) bond::OutputBuffer output; Factory::Call(output, version, boost::bind( - bond::Marshal, obj, _1)); + bond::Marshal, obj, boost::placeholders::_1)); bond::InputBuffer input = output.GetBuffer(); @@ -43,7 +43,7 @@ void Serialize(uint16_t version = bond::v1) bond::OutputBuffer output; Factory::Call(output, version, boost::bind( - bond::Serialize, obj, _1)); + bond::Serialize, obj, boost::placeholders::_1)); bond::InputBuffer input = output.GetBuffer(); Reader reader(Factory::Create(input, version)); @@ -69,7 +69,7 @@ void Apply(uint16_t version = bond::v1) bond::OutputBuffer output; Factory::Call(output, version, boost::bind( - CallApply, X>, boost::bind(bond::SerializeTo, _1), obj)); + CallApply, X>, boost::bind(bond::SerializeTo, boost::placeholders::_1), obj)); bond::InputBuffer input = output.GetBuffer(); Reader reader(Factory::Create(input, version)); @@ -91,7 +91,7 @@ void SimpleApply(uint16_t version = bond::v1) typename Writer::Buffer output; Factory::Call(output, version, boost::bind( - CallApply, X>, boost::bind(bond::SerializeTo, _1), obj)); + CallApply, X>, boost::bind(bond::SerializeTo, boost::placeholders::_1), obj)); } @@ -114,7 +114,7 @@ Bonded(uint16_t version = bond::v1) bond::OutputBuffer output; Factory::Call(output, version, boost::bind( - bond::Serialize, obj, _1)); + bond::Serialize, obj, boost::placeholders::_1)); bond::InputBuffer input = output.GetBuffer(); Reader reader(Factory::Create(input, version)); @@ -122,7 +122,7 @@ Bonded(uint16_t version = bond::v1) bond::OutputBuffer output2; Factory::Call(output2, version, boost::bind( - &bond::bonded::template Serialize, bonded, _1)); + &bond::bonded::template Serialize, bonded, boost::placeholders::_1)); bond::InputBuffer input2 = output2.GetBuffer(); Reader reader2(Factory::Create(input2, version)); diff --git a/cpp/test/core/exception_tests.cpp b/cpp/test/core/exception_tests.cpp index 036229315b..4263c807ad 100644 --- a/cpp/test/core/exception_tests.cpp +++ b/cpp/test/core/exception_tests.cpp @@ -259,7 +259,7 @@ TEST_CASE_BEGIN(TransformException) typename Writer::Buffer buffer(4096); Factory::Call(buffer, bond::v1, boost::bind( - bond::Serialize, InitRandom(2, 2), _1)); + bond::Serialize, InitRandom(2, 2), boost::placeholders::_1)); { for (int i = 0;; ++i) diff --git a/cpp/test/core/marshal.cpp b/cpp/test/core/marshal.cpp index 6d0384e30c..b49b2e88ef 100644 --- a/cpp/test/core/marshal.cpp +++ b/cpp/test/core/marshal.cpp @@ -9,7 +9,7 @@ void MarshalingTest(uint16_t version = bond::v1) typename Writer::Buffer output_buffer; Factory::Call(output_buffer, version, boost::bind( - bond::Marshal, from, _1)); + bond::Marshal, from, boost::placeholders::_1)); T to; bond::InputBuffer input(output_buffer.GetBuffer()); @@ -38,7 +38,7 @@ void TranscodingTest(uint16_t version = bond::v1) typename Writer::Buffer output_buffer; Factory::Call(output_buffer, version, boost::bind( - bond::Marshal, from, _1)); + bond::Marshal, from, boost::placeholders::_1)); // Trans-marshal to Simple Protocol using runtime schema bond::OutputBuffer simple_buffer; @@ -58,7 +58,7 @@ void TranscodingTest(uint16_t version = bond::v1) { bond::InputBuffer input(simple_buffer.GetBuffer()); Factory::Call(writer_buffer, version, boost::bind( - bond::SelectProtocolAndApply >, input, boost::bind(bond::MarshalTo, _1))); + bond::SelectProtocolAndApply >, input, boost::bind(bond::MarshalTo, boost::placeholders::_1))); } T to; @@ -76,7 +76,7 @@ void TranscodingTest(uint16_t version = bond::v1) { bond::InputBuffer input(simple_buffer.GetBuffer()); Factory::Call(writer_buffer, version, boost::bind( - bond::SelectProtocolAndApply >, bond::GetRuntimeSchema(), input, boost::bind(bond::MarshalTo, _1))); + bond::SelectProtocolAndApply >, bond::GetRuntimeSchema(), input, boost::bind(bond::MarshalTo, boost::placeholders::_1))); } T to; diff --git a/cpp/test/core/pass_through.cpp b/cpp/test/core/pass_through.cpp index 87923b9300..6f89336c05 100644 --- a/cpp/test/core/pass_through.cpp +++ b/cpp/test/core/pass_through.cpp @@ -352,7 +352,7 @@ void DefaultValuesTranscodingTest(T to, uint16_t version1 = bond::v1, uint16_t v typename Writer2::Buffer output_buffer(4096); Factory::Call(output_buffer, version2, boost::bind( - &bond::bonded::template Serialize, bonded1, _1)); + &bond::bonded::template Serialize, bonded1, boost::placeholders::_1)); typename Reader2::Buffer input_buffer(output_buffer.GetBuffer()); Reader2 input = Factory::Create(input_buffer, version2); diff --git a/cpp/test/core/required_fields_tests.cpp b/cpp/test/core/required_fields_tests.cpp index ede688b040..2b3a9fa555 100644 --- a/cpp/test/core/required_fields_tests.cpp +++ b/cpp/test/core/required_fields_tests.cpp @@ -111,7 +111,7 @@ TEST_CASE_BEGIN(OptionalToRequired) typename Writer::Buffer buffer(1024); Factory::Call(buffer, bond::v1, boost::bind( - bond::Serialize, from, _1)); + bond::Serialize, from, boost::placeholders::_1)); { To to; diff --git a/cpp/test/core/unit_test_util.h b/cpp/test/core/unit_test_util.h index 66d6395033..cfea5e67c7 100644 --- a/cpp/test/core/unit_test_util.h +++ b/cpp/test/core/unit_test_util.h @@ -17,7 +17,7 @@ using bond::string_length; #include #include -#include +#include #include using namespace std; @@ -278,7 +278,7 @@ Reader Serialize(const T& x, uint16_t version = bond::v1) // serialize value to output Factory::Call(output_buffer, version, boost::bind( - bond::Serialize, x, _1)); + bond::Serialize, x, boost::placeholders::_1)); typename Reader::Buffer input_buffer(output_buffer.GetBuffer()); return Factory::Create(input_buffer, version); @@ -309,7 +309,7 @@ Reader Merge(const Payload& payload, const T& x, uint16_t version = bond::v1) // merge x with serialized payload into output Factory::Call(output_buffer, version, boost::bind( - bond::Merge, x, Serialize(payload, version), _1)); + bond::Merge, x, Serialize(payload, version), boost::placeholders::_1)); typename Reader::Buffer input_buffer(output_buffer.GetBuffer()); diff --git a/examples/cpp/core/runtime_binding/runtime_binding.cpp b/examples/cpp/core/runtime_binding/runtime_binding.cpp index b0c27c78c1..48fcfe02bc 100644 --- a/examples/cpp/core/runtime_binding/runtime_binding.cpp +++ b/examples/cpp/core/runtime_binding/runtime_binding.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include using namespace examples::runtime_binding; @@ -54,12 +54,12 @@ void Map(const bond::RuntimeSchema& from_schema, std::string from_name, // Find the field from_name in from_schema ... Field from = find_if(from_schema.GetStruct().fields.begin(), from_schema.GetStruct().fields.end(), - boost::bind(&ByName, _1, from_name)); + boost::bind(&ByName, boost::placeholders::_1, from_name)); // ... and field to_name in to_schema Field to = find_if(to_schema.GetStruct().fields.begin(), to_schema.GetStruct().fields.end(), - boost::bind(&ByName, _1, to_name)); + boost::bind(&ByName, boost::placeholders::_1, to_name)); // Add mapping (for clarity omits error checking) mappings[from->id].path.push_back(to->id);