1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template<class T> class valarray;
13 // valarray(const value_type& x, size_t n);
18 #include "test_macros.h"
23 std::valarray
<int> v(5, 100);
24 assert(v
.size() == 100);
25 for (int i
= 0; i
< 100; ++i
)
29 std::valarray
<double> v(2.5, 100);
30 assert(v
.size() == 100);
31 for (int i
= 0; i
< 100; ++i
)
35 std::valarray
<std::valarray
<double> > v(std::valarray
<double>(10), 100);
36 assert(v
.size() == 100);
37 for (int i
= 0; i
< 100; ++i
)
38 assert(v
[i
].size() == 10);