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 // dynarray.zero 11 12 // dynarray shall provide support for the special case of construction with a size of zero. 13 // In the case that the size is zero, begin() == end() == unique value. 14 // The return value of data() is unspecified. 15 // The effect of calling front() or back() for a zero-sized dynarray is undefined. 16 17 18 19 #include <__config> 20 21 #if _LIBCPP_STD_VER > 11 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 #else 49 int main() {} 50 #endif 51