]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
Vendor import of libc++ trunk r302418:
[FreeBSD/FreeBSD.git] / test / libcxx / experimental / containers / sequences / dynarray / dynarray.zero / default.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // UNSUPPORTED: c++98, c++03, c++11
11 // XFAIL: availability
12 // dynarray.zero
13
14 // dynarray shall provide support for the special case of construction with a size of zero.
15 // In the case that the size is zero, begin() == end() == unique value.
16 // The return value of data() is unspecified.
17 // The effect of calling front() or back() for a zero-sized dynarray is undefined.
18
19
20
21 #include <__config>
22
23 #include <experimental/dynarray>
24 #include <cassert>
25
26 #include <algorithm>
27 #include <complex>
28 #include <string>
29
30 using std::experimental::dynarray;
31
32 template <class T>
33 void test ( ) {
34     typedef dynarray<T> dynA;
35
36     dynA d1 ( 0 );
37     assert ( d1.size() == 0 );
38     assert ( d1.begin() == d1.end ());
39     }
40
41 int main()
42 {
43     test<int> ();
44     test<double> ();
45     test<std::complex<double>> ();
46     test<std::string> ();
47 }
48