From 1819e88e84e402920955a6453cff495f61a43e82 Mon Sep 17 00:00:00 2001 From: Nicolas Lesser Date: Thu, 6 Dec 2018 14:56:59 +0100 Subject: [PATCH] Better asserts. --- include/fmt/color.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index 09d430aa..edd8944e 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -293,15 +293,15 @@ public: return static_cast(ems); } FMT_CONSTEXPR_DECL rgb get_foreground() const FMT_NOEXCEPT { - assert(set_foreground_color); + assert(has_foreground() && "no foreground specified for this style"); return foreground_color; } FMT_CONSTEXPR_DECL rgb get_background() const FMT_NOEXCEPT { - assert(set_background_color); + assert(has_background() && "no background specified for this style"); return background_color; } FMT_CONSTEXPR emphasis get_emphasis() const FMT_NOEXCEPT { - assert(ems); + assert(has_emphasis() && "no emphasis specified for this style"); return ems; }