Skip to content

Commit

Permalink
Select the proper overload for boost::bind.
Browse files Browse the repository at this point in the history
In C++11 there are two viable overload of the function. Specify the
proper overload to avoid a compilation error.
  • Loading branch information
mordante committed Jun 29, 2014
1 parent c0002f2 commit 1ca23e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/unit.cpp
Expand Up @@ -434,7 +434,13 @@ unit::unit(const config &cfg, bool use_traits, const vconfig* vcfg) :
{
cfg_.clear_children("advancement");
boost::copy( cfg.child_range("advancement")
, boost::make_function_output_iterator(boost::bind( &config::add_child, boost::ref(cfg_) /*thisptr*/, "advancement", _1 )) );
, boost::make_function_output_iterator(
boost::bind(
/* The static_cast is required to select the proper overload in C++11 mode. */
static_cast<config&(config::*)(const std::string &, const config&)>(&config::add_child)
, boost::ref(cfg_) /*thisptr*/
, "advancement"
, _1 )) );
}

//don't use the unit_type's abilities if this config has its own defined
Expand Down

0 comments on commit 1ca23e3

Please sign in to comment.