Skip to content

Commit

Permalink
Use the stdlib's ref and cref function templates.
Browse files Browse the repository at this point in the history
Switch out Boost's `ref` and `cref` function templates for the stdlib ones.

Reference:

- http://en.cppreference.com/w/cpp/utility/functional/ref
  • Loading branch information
daniel-j-h committed Sep 2, 2015
1 parent 8f984ef commit a237a31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 5 additions & 4 deletions extractor/extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <atomic>
#include <chrono>
#include <fstream>
#include <functional>
#include <iostream>
#include <thread>
#include <unordered_map>
Expand Down Expand Up @@ -178,17 +179,17 @@ int extractor::run()
++number_of_nodes;
luabind::call_function<void>(
local_state, "node_function",
boost::cref(static_cast<const osmium::Node &>(*entity)),
boost::ref(result_node));
std::cref(static_cast<const osmium::Node &>(*entity)),
std::ref(result_node));
resulting_nodes.push_back(std::make_pair(x, result_node));
break;
case osmium::item_type::way:
result_way.clear();
++number_of_ways;
luabind::call_function<void>(
local_state, "way_function",
boost::cref(static_cast<const osmium::Way &>(*entity)),
boost::ref(result_way));
std::cref(static_cast<const osmium::Way &>(*entity)),
std::ref(result_way));
resulting_ways.push_back(std::make_pair(x, result_way));
break;
case osmium::item_type::relation:
Expand Down
5 changes: 2 additions & 3 deletions extractor/restriction_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../util/osrm_exception.hpp"
#include "../util/simple_logger.hpp"

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/ref.hpp>
#include <boost/regex.hpp>

#include <algorithm>
#include <functional>

namespace
{
Expand Down Expand Up @@ -87,7 +86,7 @@ void RestrictionParser::ReadRestrictionExceptions(lua_State *lua_state)
luabind::set_pcall_callback(&lua_error_callback);
// get list of turn restriction exceptions
luabind::call_function<void>(lua_state, "get_exceptions",
boost::ref(restriction_exceptions));
std::ref(restriction_exceptions));
const unsigned exception_count = restriction_exceptions.size();
SimpleLogger().Write() << "Found " << exception_count
<< " exceptions to turn restrictions:";
Expand Down

0 comments on commit a237a31

Please sign in to comment.