mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 11:27:15 +02:00
Unordered: Account for cost of creating tuple.
[SVN r74133]
This commit is contained in:
@ -408,14 +408,20 @@ namespace unnecessary_copy_tests
|
|||||||
std::make_tuple(std::ref(b.second)));
|
std::make_tuple(std::ref(b.second)));
|
||||||
COPY_COUNT(0); MOVE_COUNT(0);
|
COPY_COUNT(0); MOVE_COUNT(0);
|
||||||
|
|
||||||
// first is const so it is copied.
|
std::pair<count_copies const, count_copies> move_source_trial;
|
||||||
// second is not const so it is moved.
|
reset();
|
||||||
|
std::make_tuple(std::move(move_source_trial.first));
|
||||||
|
std::make_tuple(std::move(move_source_trial.second));
|
||||||
|
int tuple_move_cost = ::unnecessary_copy_tests::count_copies::moves;
|
||||||
|
int tuple_copy_cost = ::unnecessary_copy_tests::count_copies::copies;
|
||||||
|
|
||||||
std::pair<count_copies const, count_copies> move_source;
|
std::pair<count_copies const, count_copies> move_source;
|
||||||
reset();
|
reset();
|
||||||
x.emplace(boost::unordered::piecewise_construct,
|
x.emplace(boost::unordered::piecewise_construct,
|
||||||
std::make_tuple(std::move(move_source.first)),
|
std::make_tuple(std::move(move_source.first)),
|
||||||
std::make_tuple(std::move(move_source.second)));
|
std::make_tuple(std::move(move_source.second)));
|
||||||
COPY_COUNT(1); MOVE_COUNT(1);
|
COPY_COUNT(tuple_copy_cost);
|
||||||
|
MOVE_COUNT(tuple_move_cost);
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ > 4 || \
|
#if defined(__GNUC__) && __GNUC__ > 4 || \
|
||||||
defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 6
|
defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 6
|
||||||
|
Reference in New Issue
Block a user