File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
source/containers/test/sort Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,24 +18,25 @@ using namespace bounded::literal;
18
18
19
19
template <std::size_t size>
20
20
struct data {
21
+ data () = default ;
21
22
constexpr explicit data (unsigned value) {
22
23
for (auto const n : containers::integer_range (bounded::constant<size>)) {
23
24
m[n] = static_cast <std::uint8_t >(value);
24
25
}
25
26
}
26
27
friend constexpr auto operator <=>(data const & lhs, data const & rhs) = default ;
27
- containers::array<std::uint8_t , bounded::constant<size>> m;
28
+
29
+ containers::array<std::uint8_t , bounded::constant<size>> m = {};
28
30
};
29
31
30
32
template <std::size_t data_size, auto function>
31
33
auto benchmark_sort (benchmark::State & state) -> void {
32
34
auto engine = std::mt19937 (std::random_device ()());
33
35
auto value_distribution = std::uniform_int_distribution<unsigned >();
34
36
using container_t = containers::vector<data<data_size>>;
35
- auto container = container_t ();
36
37
using size_type = containers::range_size_t <container_t >;
37
38
auto const size = bounded::assume_in_range<size_type>(state.range (0 ));
38
- container. reserve ( size);
39
+ auto container = container_t (containers::repeat_default_n<data<data_size>>( size) );
39
40
40
41
for (auto _ : state) {
41
42
containers::copy (
You can’t perform that action at this time.
0 commit comments