diff --git a/include/internal/benchmark/catch_constructor.hpp b/include/internal/benchmark/catch_constructor.hpp index 7525bf01..4fc04042 100644 --- a/include/internal/benchmark/catch_constructor.hpp +++ b/include/internal/benchmark/catch_constructor.hpp @@ -55,11 +55,15 @@ namespace Catch { template void destruct_on_exit(typename std::enable_if::type* = 0) { } - T& stored_object() - { + T& stored_object() { return *static_cast(static_cast(&data)); } + T const& stored_object() const { + return *static_cast(static_cast(&data)); + } + + TStorage data; }; }