Use forward_tuple to prevent needless copies

This commit is contained in:
Vinnie Falco
2014-02-21 12:46:16 -08:00
parent a336cc26f9
commit 616a53888e
6 changed files with 26 additions and 17 deletions

View File

@@ -42,8 +42,8 @@ public:
void add (std::string const& method, handler_type&& handler)
{
std::pair <Map::iterator, bool> result (m_map.emplace (
std::piecewise_construct, std::make_tuple (method),
std::make_tuple (std::move (handler))));
std::piecewise_construct, std::forward_as_tuple (method),
std::forward_as_tuple (std::move (handler))));
}
bool dispatch (Request& req)