Unordred: Implement propagate_on_container_swap.

[SVN r73680]
This commit is contained in:
Daniel James
2011-08-11 21:18:43 +00:00
parent eacca89d4e
commit 0e5930b8dc
11 changed files with 95 additions and 95 deletions

View File

@@ -34,6 +34,16 @@ namespace exception
template <class T> class allocator;
object generate(object const*);
struct true_type
{
enum { value = true };
};
struct false_type
{
enum { value = false };
};
class object
{
public:
@@ -340,7 +350,7 @@ namespace exception
}
void construct(pointer p, T const& t) {
UNORDERED_SCOPE(allocator::construct(pointer, T)) {
UNORDERED_SCOPE(allocator::construct(T*, T)) {
UNORDERED_EPOINT("Mock allocator construct function.");
new(p) T(t);
}
@@ -348,7 +358,7 @@ namespace exception
}
#if defined(BOOST_UNORDERED_STD_FORWARD_MOVE)
template<class... Args> void construct(pointer p, Args&&... args) {
template<class... Args> void construct(T* p, Args&&... args) {
UNORDERED_SCOPE(allocator::construct(pointer, Args&&...)) {
UNORDERED_EPOINT("Mock allocator construct function.");
new(p) T(std::forward<Args>(args)...);
@@ -357,7 +367,7 @@ namespace exception
}
#endif
void destroy(pointer p) {
void destroy(T* p) {
detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
p->~T();
}
@@ -368,6 +378,10 @@ namespace exception
}
return (std::numeric_limits<std::size_t>::max)();
}
typedef true_type propagate_on_container_copy_assignment;
typedef true_type propagate_on_container_move_assignment;
typedef true_type propagate_on_container_swap;
};
template <class T>