From 621b0003948b34c9d8c98abb4855003a87fa5aa5 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 25 Dec 2018 10:34:40 +0100 Subject: [PATCH] fix debug builds --- src/cpp-utils/either.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cpp-utils/either.h b/src/cpp-utils/either.h index d428294d..06c7d28d 100644 --- a/src/cpp-utils/either.h +++ b/src/cpp-utils/either.h @@ -80,7 +80,9 @@ namespace cpputils { } const Left &left() const& { - ASSERT(is_left(), "Tried to get left side of an either which is right."); + if (!is_left()) { + throw std::logic_error("Tried to get left side of an either which is right."); + } return _left; } Left &left() & { @@ -91,7 +93,9 @@ namespace cpputils { } const Right &right() const& { - ASSERT(is_right(), "Tried to get right side of an either which is left."); + if (!is_right()) { + throw std::logic_error("Tried to get right side of an either which is left."); + } return _right; } Right &right() & {