Merge pull request #326 from oleksandr-pavlyk/fix-sfinae-incomplete

Fix GCC16 sfinae incomplete warnings.

GCC16 started requiring that the type `T` used in `std::reference_wrapper<T>` is complete where using `-std=c++17`. Since NVBench has to forward declare some types in header files to break circular dependency, use of incomplete type breaks build due to use of `-Werror` flag due to `-Wsfinae-incomplete` warning emitted by GCC16.

This commit replaced affected uses of `std::reference_wrapper<const nvbench::benchmark_base>` in state.cxx, and `std::reference_wrapper<nvbench::printer_base>` in benchmark_base.cxx with raw pointers.
This commit is contained in:
Oleksandr Pavlyk
2026-03-24 16:02:28 -05:00
committed by GitHub
parent 317dc6824e
commit 836a6c12f4
11 changed files with 44 additions and 51 deletions

View File

@@ -710,7 +710,7 @@ Returns True if configuration has a device
// method State.has_printers
auto method_has_printers_impl = [](const nvbench::state &state) -> bool {
return state.get_benchmark().get_printer().has_value();
return state.get_benchmark().get_printer() != nullptr;
};
static constexpr const char *method_has_printers_doc = R"XXXX(
Returns True if configuration has a printer"