diff --git a/source/stdcpp/set.d b/source/stdcpp/set.d index ef7f6b2..8158bf9 100644 --- a/source/stdcpp/set.d +++ b/source/stdcpp/set.d @@ -36,6 +36,7 @@ extern(C++, class) struct set(Key, compare, Alloc) version (CppRuntime_Gcc) { + /// this(const ref allocator!(Key)); /// extern(D) this(const compare comp) diff --git a/source/stdcpp/test/set.d b/source/stdcpp/test/set.d index ef4f424..b5ddff3 100644 --- a/source/stdcpp/test/set.d +++ b/source/stdcpp/test/set.d @@ -9,38 +9,41 @@ module stdcpp.test.set; import stdcpp.set; import stdcpp.test.base; -unittest +version (CppRuntime_Gcc) { - assert(cppSizeOf!(vector!int) == vector!int.sizeof); -} + unittest + { + assert(cppSizeOf!(set!int) == set!int.sizeof); + } -unittest -{ - import stdcpp.allocator; - allocator!int alloc_instance = allocator!(int).init; - less!int a; - auto p = set!int(a); - p.insert(5); - assert(p.size == 1); - assert(p.empty == 0); - p.erase(5); - p.insert(6); - p.clear; - assert(p.size == 0); - assert(p.empty == 1); - set!int q = a; - q.swap(p); - q.insert(4); - q.insert(4); - q.insert(4); - assert(q.size == 1); - assert(q.count(4) == 1);//count for set only results in 0 for not present or 1 for present - assert(q.count(5) == 0); - assert(q.contains(4) == 1); // q contains 4 evaluates to true - auto iter = q.find(4); - set!int w = q; //copy constructor - assert(w.size() == 1); - auto alloc = set!int(alloc_instance); - alloc.insert(5); - assert(alloc.size() == 1); + unittest + { + import stdcpp.allocator; + allocator!int alloc_instance = allocator!(int).init; + less!int a; + auto p = set!int(a); + p.insert(5); + assert(p.size == 1); + assert(p.empty == 0); + p.erase(5); + p.insert(6); + p.clear; + assert(p.size == 0); + assert(p.empty == 1); + set!int q = a; + q.swap(p); + q.insert(4); + q.insert(4); + q.insert(4); + assert(q.size == 1); + assert(q.count(4) == 1);//count for set only results in 0 for not present or 1 for present + assert(q.count(5) == 0); + assert(q.contains(4) == 1); // q contains 4 evaluates to true + auto iter = q.find(4); + set!int w = q; //copy constructor + assert(w.size() == 1); + auto alloc = set!int(alloc_instance); + alloc.insert(5); + assert(alloc.size() == 1); + } } \ No newline at end of file