From e334e5f43d5e772fccc811b415723374e51ea558 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Thu, 28 Jan 2021 12:28:15 +1100 Subject: [PATCH] Fixed build --- src/config.hpp | 2 +- src/utils/optional_reference.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config.hpp b/src/config.hpp index a34f2ea38da7..1e62c45b25d3 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -324,7 +324,7 @@ class config instances--; } - static const bool do_throw() + static bool do_throw() { return instances > 0; } diff --git a/src/utils/optional_reference.hpp b/src/utils/optional_reference.hpp index 76702c5aac5b..0c0c437a0d14 100644 --- a/src/utils/optional_reference.hpp +++ b/src/utils/optional_reference.hpp @@ -56,7 +56,9 @@ class optional_reference if(opt_) { return opt_->get(); } else { - throw std::bad_optional_access{}; + // We're going to drop this codepath once we can use optional::value anyway, but just + // noting we want this function to ultimately throw std::bad_optional_access. + throw std::runtime_error("Optional reference has no value"); } #endif }