retname.offsets_.assign(&offsets_[0], &offsets_[0] + labelcount_ - 1);
transform(suffix.offsets_.begin(), suffix.offsets_.end(),
back_inserter(retname.offsets_),
- bind2nd(plus<char>(), length_ - 1));
+ [this] (char x) { return (x + length_ - 1); });
isc_throw_assert(retname.offsets_.size() == labels);
retname.labelcount_ = labels;
retname.offsets_.reserve(newlabels);
transform(offsets_.begin() + first, offsets_.begin() + first + newlabels,
back_inserter(retname.offsets_),
- bind2nd(plus<char>(), -offsets_[first]));
+ [&](char x) { return (x - offsets_[first]); });
//
// Set up the new name. At this point the tail of the new offsets specifies
-// Copyright (C) 2010-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// object)
rr_stream << txt_rr << a_rr1 << soa_rr;
masterLoad(rr_stream, origin, zclass,
- bind2nd(ptr_fun(testCallback), &results));
+ boost::bind(&testCallback, _1, &results));
ASSERT_EQ(3, results.size());
EXPECT_EQ(txt_rr, results[0]->toText());
EXPECT_EQ(a_rr1, results[1]->toText());
TEST_F(MasterLoadTest, loadEmpty) {
// an unusual case: empty input. load must succeed with an empty result.
masterLoad(rr_stream, origin, zclass, callback);
- EXPECT_EQ(0, results.size());
+ EXPECT_EQ(0, results.size());
}
TEST_F(MasterLoadTest, loadWithBeginningSpace) {
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// all the matching elements.
hook_vector_[hook_index].erase(remove_if(hook_vector_[hook_index].begin(),
hook_vector_[hook_index].end(),
- bind1st(equal_to<CalloutEntry>(),
- target)),
+ [&target] (CalloutEntry x) {
+ return (x == target); }),
hook_vector_[hook_index].end());
// Return an indication of whether anything was removed.
// Remove all callouts matching this library.
hook_vector_[hook_index].erase(remove_if(hook_vector_[hook_index].begin(),
hook_vector_[hook_index].end(),
- bind1st(CalloutLibraryEqual(),
- target)),
+ [&target] (CalloutEntry x) {
+ return (x.first == target.first);
+ }),
hook_vector_[hook_index].end());
// Return an indication of whether anything was removed.
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @throw NoSuchLibrary Library index is not valid.
void checkLibraryIndex(int library_index) const;
- /// @brief Compare two callout entries for library equality
- ///
- /// This is used in callout removal code when all callouts on a hook for a
- /// given library are being removed. It checks whether two callout entries
- /// have the same library index.
- ///
- /// @param ent1 First callout entry to check
- /// @param ent2 Second callout entry to check
- ///
- /// @return bool true if the library entries are the same
- class CalloutLibraryEqual :
- public std::binary_function<CalloutEntry, CalloutEntry, bool> {
- public:
- bool operator()(const CalloutEntry& ent1,
- const CalloutEntry& ent2) const {
- return (ent1.first == ent2.first);
- }
- };
-
// Member variables
/// Reference to the singleton ServerHooks object. See the
-// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
template <typename Iterator>
bool
isRangeZero(Iterator begin, Iterator end) {
- return (std::find_if(begin, end,
- std::bind1st(std::not_equal_to<int>(), 0))
+ return (std::find_if(begin, end, [] (int x) { return (0 != x); })
== end);
}