|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-04-23 02:56:07
Author: danieljames
Date: 2008-04-23 02:56:06 EDT (Wed, 23 Apr 2008)
New Revision: 44735
URL: http://svn.boost.org/trac/boost/changeset/44735
Log:
More tests.
Text files modified:
branches/unordered/trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
Modified: branches/unordered/trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2008-04-23 02:56:06 EDT (Wed, 23 Apr 2008)
@@ -146,19 +146,19 @@
COPY_COUNT(1); MOVE_COUNT(0);
//
- // 1 arguments
+ // 1 argument
//
// Emplace should be able to tell that there already is an element
// without creating a new one.
reset();
- x.insert(a);
+ x.emplace(a);
COPY_COUNT(0); MOVE_COUNT(0);
// A new object is created by source, but it shouldn't be moved or
// copied.
reset();
- x.insert(source<count_copies>());
+ x.emplace(source<count_copies>());
COPY_COUNT(1); MOVE_COUNT(0);
// No move should take place.
@@ -224,13 +224,32 @@
x.emplace(std::move(a));
COPY_COUNT(0); MOVE_COUNT(0);
+ // Just in case a did get moved
+ std::pair<count_copies const, count_copies> b;
+
+ reset();
+ x.emplace(b.first.tag_);
+ COPY_COUNT(2); MOVE_COUNT(0);
+
//
// 2 arguments
//
reset();
+ x.emplace(b.first, b.second);
+ COPY_COUNT(2); MOVE_COUNT(0);
+
+ reset();
x.emplace(source<count_copies>(), source<count_copies>());
COPY_COUNT(2); MOVE_COUNT(0);
+
+ reset();
+ x.emplace(b.first, source<count_copies>());
+ COPY_COUNT(2); MOVE_COUNT(0);
+
+ reset();
+ x.emplace(b.first.tag_, b.second.tag_);
+ COPY_COUNT(2); MOVE_COUNT(0);
}
#endif
}
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