Move <dynarray> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194614 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -16,22 +16,24 @@ | ||||
|  | ||||
| #if _LIBCPP_STD_VER > 11 | ||||
|  | ||||
| #include <dynarray> | ||||
| #include <experimental/dynarray> | ||||
| #include <cassert> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <complex> | ||||
| #include <string> | ||||
|  | ||||
| using std::experimental::dynarray; | ||||
|  | ||||
| template <class T> | ||||
| void dyn_at_fail ( std::dynarray<T> &dyn, size_t sz ) { | ||||
| void dyn_at_fail ( dynarray<T> &dyn, size_t sz ) { | ||||
|     try { dyn.at (sz); } | ||||
|     catch (const std::out_of_range &) { return; } | ||||
|     assert ( false ); | ||||
|     } | ||||
|  | ||||
| template <class T> | ||||
| void dyn_at_fail_const ( const std::dynarray<T> &dyn, size_t sz ) { | ||||
| void dyn_at_fail_const ( const dynarray<T> &dyn, size_t sz ) { | ||||
|     try { dyn.at (sz); } | ||||
|     catch (const std::out_of_range &) { return; } | ||||
|     assert ( false ); | ||||
| @@ -39,7 +41,7 @@ void dyn_at_fail_const ( const std::dynarray<T> &dyn, size_t sz ) { | ||||
|  | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test_const ( const std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
| void dyn_test_const ( const dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|     const T *data = dyn.data (); | ||||
|     auto it = vals.begin (); | ||||
|     for ( size_t i = 0; i < dyn.size(); ++i, ++it ) { | ||||
| @@ -53,7 +55,7 @@ void dyn_test_const ( const std::dynarray<T> &dyn, const std::initializer_list<T | ||||
|     } | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test ( std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
| void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|     T *data = dyn.data (); | ||||
|     auto it = vals.begin (); | ||||
|     for ( size_t i = 0; i < dyn.size(); ++i, ++it ) { | ||||
| @@ -69,7 +71,7 @@ void dyn_test ( std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|  | ||||
| template <class T> | ||||
| void test ( std::initializer_list<T> vals ) { | ||||
|     typedef std::dynarray<T> dynA; | ||||
|     typedef dynarray<T> dynA; | ||||
|      | ||||
|     dynA d1 ( vals ); | ||||
|     dyn_test ( d1, vals ); | ||||
|   | ||||
| @@ -29,15 +29,17 @@ | ||||
|  | ||||
| #if _LIBCPP_STD_VER > 11 | ||||
|  | ||||
| #include <dynarray> | ||||
| #include <experimental/dynarray> | ||||
| #include <cassert> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <complex> | ||||
| #include <string> | ||||
|  | ||||
| using std::experimental::dynarray; | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test_const ( const std::dynarray<T> &dyn ) { | ||||
| void dyn_test_const ( const dynarray<T> &dyn ) { | ||||
|     const T *data = dyn.data (); | ||||
|     assert ( data == &*dyn.begin ()); | ||||
|     assert ( data == &*dyn.cbegin ()); | ||||
| @@ -59,7 +61,7 @@ void dyn_test_const ( const std::dynarray<T> &dyn ) { | ||||
|     } | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test ( std::dynarray<T> &dyn ) { | ||||
| void dyn_test ( dynarray<T> &dyn ) { | ||||
|     T *data = dyn.data (); | ||||
|     assert ( data == &*dyn.begin ()); | ||||
|     assert ( data == &*dyn.cbegin ()); | ||||
| @@ -83,7 +85,7 @@ void dyn_test ( std::dynarray<T> &dyn ) { | ||||
|  | ||||
| template <class T> | ||||
| void test ( const T &val ) { | ||||
|     typedef std::dynarray<T> dynA; | ||||
|     typedef dynarray<T> dynA; | ||||
|      | ||||
|     dynA d1 ( 4 ); | ||||
|     dyn_test ( d1 ); | ||||
|   | ||||
| @@ -17,15 +17,17 @@ | ||||
|  | ||||
| #if _LIBCPP_STD_VER > 11 | ||||
|  | ||||
| #include <dynarray> | ||||
| #include <experimental/dynarray> | ||||
| #include <cassert> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <complex> | ||||
| #include <string> | ||||
|  | ||||
| using std::experimental::dynarray; | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test ( const std::dynarray<T> &dyn, size_t sz ) { | ||||
| void dyn_test ( const dynarray<T> &dyn, size_t sz ) { | ||||
|     assert ( dyn.size ()     == sz ); | ||||
|     assert ( dyn.max_size () == sz ); | ||||
|     assert ( dyn.empty () == ( sz == 0 )); | ||||
| @@ -33,7 +35,7 @@ void dyn_test ( const std::dynarray<T> &dyn, size_t sz ) { | ||||
|  | ||||
| template <class T> | ||||
| void test ( std::initializer_list<T> vals ) { | ||||
|     typedef std::dynarray<T> dynA; | ||||
|     typedef dynarray<T> dynA; | ||||
|      | ||||
|     dynA d1 ( vals ); | ||||
|     dyn_test ( d1, vals.size ()); | ||||
|   | ||||
| @@ -19,22 +19,24 @@ | ||||
|  | ||||
| #if _LIBCPP_STD_VER > 11 | ||||
|  | ||||
| #include <dynarray> | ||||
| #include <experimental/dynarray> | ||||
| #include <cassert> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <complex> | ||||
| #include <string> | ||||
|  | ||||
| using std::experimental::dynarray; | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test_const ( const std::dynarray<T> &dyn ) { | ||||
| void dyn_test_const ( const dynarray<T> &dyn ) { | ||||
|     const T *data = dyn.data (); | ||||
|     assert ( *data == dyn.front ()); | ||||
|     assert ( *(data + dyn.size() - 1 ) == dyn.back ()); | ||||
|     } | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test ( std::dynarray<T> &dyn ) { | ||||
| void dyn_test ( dynarray<T> &dyn ) { | ||||
|     T *data = dyn.data (); | ||||
|     assert ( *data == dyn.front ()); | ||||
|     assert ( *(data + dyn.size() - 1 ) == dyn.back ()); | ||||
| @@ -43,7 +45,7 @@ void dyn_test ( std::dynarray<T> &dyn ) { | ||||
|  | ||||
| template <class T> | ||||
| void test ( const T &val ) { | ||||
|     typedef std::dynarray<T> dynA; | ||||
|     typedef dynarray<T> dynA; | ||||
|      | ||||
|     dynA d1 ( 4 ); | ||||
|     dyn_test ( d1 ); | ||||
|   | ||||
| @@ -16,15 +16,17 @@ | ||||
|  | ||||
| #if _LIBCPP_STD_VER > 11 | ||||
|  | ||||
| #include <dynarray> | ||||
| #include <experimental/dynarray> | ||||
| #include <cassert> | ||||
|  | ||||
| #include <algorithm> | ||||
| #include <complex> | ||||
| #include <string> | ||||
|  | ||||
| using std::experimental::dynarray; | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test_const ( const std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
| void dyn_test_const ( const dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|     const T *data = dyn.data (); | ||||
|     auto it = vals.begin (); | ||||
|     for ( size_t i = 0; i < dyn.size(); ++i, ++it ) { | ||||
| @@ -34,7 +36,7 @@ void dyn_test_const ( const std::dynarray<T> &dyn, const std::initializer_list<T | ||||
|     } | ||||
|  | ||||
| template <class T> | ||||
| void dyn_test ( std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
| void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|     T *data = dyn.data (); | ||||
|     auto it = vals.begin (); | ||||
|     for ( size_t i = 0; i < dyn.size(); ++i, ++it ) { | ||||
| @@ -46,7 +48,7 @@ void dyn_test ( std::dynarray<T> &dyn, const std::initializer_list<T> &vals ) { | ||||
|  | ||||
| template <class T> | ||||
| void test ( std::initializer_list<T> vals ) { | ||||
|     typedef std::dynarray<T> dynA; | ||||
|     typedef dynarray<T> dynA; | ||||
|      | ||||
|     dynA d1 ( vals ); | ||||
|     dyn_test ( d1, vals ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Marshall Clow
					Marshall Clow