From e26621df352272688834361e7d026338cefb1372 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 25 Feb 2015 18:47:56 +0100 Subject: Added `Cond` branch condition assertion * improves error messages in case no branch condition resolves to `true` --- src/conditional/cond.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/conditional/cond.h b/src/conditional/cond.h index 5f8014f..ca5e46d 100644 --- a/src/conditional/cond.h +++ b/src/conditional/cond.h @@ -12,12 +12,20 @@ namespace detail { template using cond_predicate = IsTrue>; +template +struct select_cond_branch { + using type = Eval>; + + static_assert( + IsPair::value, + "all branch conditions resolve to false" + ); +}; + } template -using Cond = Cdr ->>; +using Cond = Cdr>>; template < typename Condition, -- cgit v1.2.3