Skip to content

Commit

Permalink
Replace boost map_list_of with C++11 initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jul 29, 2016
1 parent 8ec544e commit 46bb3c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
10 changes: 0 additions & 10 deletions src/formula/string_utils.hpp
Expand Up @@ -54,16 +54,6 @@ std::string interpolate_variables_into_string(const std::string &str, const vari
t_string interpolate_variables_into_tstring(const t_string &str, const variable_set& variables);

}
/// An alias for boost::assign::map_list_of<std::string, std::string>
inline boost::assign_detail::generic_list< std::pair
<
boost::assign_detail::assign_decay<std::string>::type,
boost::assign_detail::assign_decay<std::string>::type
> >
string_map_of(const std::string& k, const std::string& v)
{
return boost::assign::map_list_of<std::string, std::string>(k, v);
}

/** Handy wrappers around interpolate_variables_into_string and gettext. */
std::string vgettext(const char* msgid, const utils::string_map& symbols);
Expand Down
6 changes: 2 additions & 4 deletions src/game_initialization/connect_engine.cpp
Expand Up @@ -28,7 +28,6 @@
#include "multiplayer_ui.hpp" // For get_color_string
#include "wesnothd_connection.hpp"

#include <boost/assign.hpp>
#include <stdlib.h>
#include <ctime>

Expand Down Expand Up @@ -1024,9 +1023,8 @@ config side_engine::new_config() const
res["user_description"] = t_string(desc, "wesnoth");
desc = vgettext(
"$playername $side",
boost::assign::map_list_of
("playername", _(desc.c_str()))
("side", res["side"].str())
{std::make_pair("playername", _(desc.c_str())),
std::make_pair("side", res["side"].str())}
);
} else if (!player_id_.empty()) {
desc = player_id_;
Expand Down
2 changes: 1 addition & 1 deletion src/synced_user_choice.cpp
Expand Up @@ -325,7 +325,7 @@ void user_choice_manager::update_local_choice()
}
}
}
wait_message_ = vgettext("waiting for $desc from side(s)$sides", string_map_of("desc", uch_.description())("sides", sides_str));
wait_message_ = vgettext("waiting for $desc from side(s)$sides", {std::make_pair("desc", uch_.description()), std::make_pair("sides", sides_str)});
if(local_choice_prev != local_choice_) {
changed_event_.notify_observers();
}
Expand Down

0 comments on commit 46bb3c3

Please sign in to comment.