Skip to content

Commit 93d9a3d

Browse files
committed
Make sure ctor(size) is available
1 parent 345ac67 commit 93d9a3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcxx/test/benchmarks/containers/container_benchmarks.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ void sequence_container_benchmarks(std::string container) {
383383
}
384384

385385
// constructors
386-
benchmark::RegisterBenchmark(container + "::ctor(size)", BM_ctor_size<Container>)->Arg(1024);
386+
if constexpr (std::is_constructible_v<Container, std::size_t>) {
387+
// not all containers provide this one
388+
benchmark::RegisterBenchmark(container + "::ctor(size)", BM_ctor_size<Container>)->Arg(1024);
389+
}
387390
for (auto gen : generators)
388391
benchmark::RegisterBenchmark(container + "::ctor(size, value_type)" + tostr(gen), [=](auto& st) {
389392
BM_ctor_size_value<Container>(st, gen);

0 commit comments

Comments
 (0)