|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75216 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-11-01 14:57:44
Author: danieljames
Date: 2011-11-01 14:57:43 EDT (Tue, 01 Nov 2011)
New Revision: 75216
URL: http://svn.boost.org/trac/boost/changeset/75216
Log:
Quickbook: Use `boost::unordered::piecewise_construct`.
Text files modified:
branches/quickbook-dev/tools/quickbook/src/id_generator.cpp | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
Modified: branches/quickbook-dev/tools/quickbook/src/id_generator.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/id_generator.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/id_generator.cpp 2011-11-01 14:57:43 EDT (Tue, 01 Nov 2011)
@@ -124,7 +124,9 @@
{
std::string result;
- id_data& data = ids.emplace(value, value, category).first->second;
+ id_data& data = ids.emplace(boost::unordered::piecewise_construct,
+ boost::make_tuple(value),
+ boost::make_tuple(value, category)).first->second;
// Doesn't check if explicit ids collide, could probably be a warning.
if (category == explicit_id)
@@ -208,8 +210,10 @@
// Not caring too much about 'category' and 'used', would want to if
// still creating ids.
std::pair<boost::unordered_map<std::string, id_data>::iterator, bool>
- insert = ids.emplace(placeholder->final_id, placeholder->final_id,
- placeholder->category, true);
+ insert = ids.emplace(boost::unordered::piecewise_construct,
+ boost::make_tuple(placeholder->final_id),
+ boost::make_tuple(placeholder->final_id,
+ placeholder->category, true));
if (insert.first->second.generation_data)
{
@@ -256,8 +260,10 @@
placeholder->data->generation_data->parent + name;
std::pair<boost::unordered_map<std::string, id_data>::iterator, bool>
- insert = ids.emplace(placeholder->final_id, placeholder->final_id,
- placeholder->category, true);
+ insert = ids.emplace(boost::unordered::piecewise_construct,
+ boost::make_tuple(placeholder->final_id),
+ boost::make_tuple(placeholder->final_id,
+ placeholder->category, true));
++placeholder->data->generation_data->count;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk