xref: /minix3/external/bsd/libc++/dist/libcxx/test/containers/associative/multiset/empty.pass.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
14684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
24684ddb6SLionel Sambuc //
34684ddb6SLionel Sambuc //                     The LLVM Compiler Infrastructure
44684ddb6SLionel Sambuc //
54684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
64684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
74684ddb6SLionel Sambuc //
84684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
94684ddb6SLionel Sambuc 
104684ddb6SLionel Sambuc // <set>
114684ddb6SLionel Sambuc 
124684ddb6SLionel Sambuc // class multiset
134684ddb6SLionel Sambuc 
144684ddb6SLionel Sambuc // bool empty() const;
154684ddb6SLionel Sambuc 
164684ddb6SLionel Sambuc #include <set>
174684ddb6SLionel Sambuc #include <cassert>
184684ddb6SLionel Sambuc 
19*0a6a1f1dSLionel Sambuc #include "min_allocator.h"
204684ddb6SLionel Sambuc 
main()214684ddb6SLionel Sambuc int main()
224684ddb6SLionel Sambuc {
234684ddb6SLionel Sambuc     {
244684ddb6SLionel Sambuc     typedef std::multiset<int> M;
254684ddb6SLionel Sambuc     M m;
264684ddb6SLionel Sambuc     assert(m.empty());
274684ddb6SLionel Sambuc     m.insert(M::value_type(1));
284684ddb6SLionel Sambuc     assert(!m.empty());
294684ddb6SLionel Sambuc     m.clear();
304684ddb6SLionel Sambuc     assert(m.empty());
314684ddb6SLionel Sambuc     }
324684ddb6SLionel Sambuc #if __cplusplus >= 201103L
334684ddb6SLionel Sambuc     {
344684ddb6SLionel Sambuc     typedef std::multiset<int, std::less<int>, min_allocator<int>> M;
354684ddb6SLionel Sambuc     M m;
364684ddb6SLionel Sambuc     assert(m.empty());
374684ddb6SLionel Sambuc     m.insert(M::value_type(1));
384684ddb6SLionel Sambuc     assert(!m.empty());
394684ddb6SLionel Sambuc     m.clear();
404684ddb6SLionel Sambuc     assert(m.empty());
414684ddb6SLionel Sambuc     }
424684ddb6SLionel Sambuc #endif
434684ddb6SLionel Sambuc }
44