|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74144 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-08-29 13:14:49
Author: danieljames
Date: 2011-08-29 13:14:48 EDT (Mon, 29 Aug 2011)
New Revision: 74144
URL: http://svn.boost.org/trac/boost/changeset/74144
Log:
Quickbook: Use `boost::unordered::piecewise_construct`.
Text files modified:
trunk/tools/quickbook/src/id_generator.cpp | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
Modified: trunk/tools/quickbook/src/id_generator.cpp
==============================================================================
--- trunk/tools/quickbook/src/id_generator.cpp (original)
+++ trunk/tools/quickbook/src/id_generator.cpp 2011-08-29 13:14:48 EDT (Mon, 29 Aug 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