Skip to content

Commit

Permalink
WIP: using the correct SFINAE pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Nov 14, 2024
1 parent 34b01fe commit 8024e39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions static/rational/conversion/assignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

namespace sw { namespace universal {

template<typename RationalType,
typename = typename std::enable_if_t<is_rational<RationalType>, RationalType> >
// WRONG SFINAE as it yields a default template argument that is ambiguous and leads to redeclaration
//template<typename RationalType,
// typename = typename std::enable_if_t<is_rational<RationalType>, RationalType> >

template<typename RationalType, std::enable_if_t<is_rational<RationalType>, bool> = true >
int ValidateAssignment(bool reportTestCases) {
constexpr unsigned nbits = RationalType::nbits;
static_assert(nbits <= 20, "rational state space is too large to exhaustively test with ValidateAssignment<rational>");
Expand Down

0 comments on commit 8024e39

Please sign in to comment.