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;
1818
1919template <std::size_t size>
2020struct data {
21+ data () = default ;
2122 constexpr explicit data (unsigned value) {
2223 for (auto const n : containers::integer_range (bounded::constant<size>)) {
2324 m[n] = static_cast <std::uint8_t >(value);
2425 }
2526 }
2627 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 = {};
2830};
2931
3032template <std::size_t data_size, auto function>
3133auto benchmark_sort (benchmark::State & state) -> void {
3234 auto engine = std::mt19937 (std::random_device ()());
3335 auto value_distribution = std::uniform_int_distribution<unsigned >();
3436 using container_t = containers::vector<data<data_size>>;
35- auto container = container_t ();
3637 using size_type = containers::range_size_t <container_t >;
3738 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) );
3940
4041 for (auto _ : state) {
4142 containers::copy (
You can’t perform that action at this time.
0 commit comments