Skip to content

Commit

Permalink
Merge remote-tracking branch 'organization/development' into feature-2.0
Browse files Browse the repository at this point in the history
Conflicts:
	src/wrappers.hpp
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Feb 1, 2017
2 parents 1b543ff + 6bb28e2 commit 0a29121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wrappers.hpp
Expand Up @@ -749,7 +749,7 @@ constexpr T Which(bool cond, T value) noexcept
}

template<typename T, typename ... Trest>
constexpr T Which(bool cond, T value, Trest... rest) noexcept
constexpr typename std::common_type<T, Trest...>::type Which(bool cond, T value, Trest... rest) noexcept
{
return cond ? value : Which(rest...);
}
Expand Down
3 changes: 3 additions & 0 deletions test/test_wrappers.cpp
Expand Up @@ -298,6 +298,9 @@ BOOST_AUTO_TEST_CASE(test_Which)
BOOST_CHECK_EQUAL(std::real(Which(true , std::complex<double>(2.,2.))), 2.);
BOOST_CHECK_EQUAL(Which(false, std::complex<double>(2.,2.), true, 3.), 3.);
BOOST_CHECK_EQUAL(Which(false, std::complex<double>(2.,2.), false, 3., true, 4.), 4.);

BOOST_CHECK_EQUAL(Which(false, 0, true, 0.5), 0.5);
BOOST_CHECK_EQUAL(Which(false, 0, false, 0, true, 0.5), 0.5);
}

BOOST_AUTO_TEST_CASE(test_MaxRelDiff)
Expand Down

0 comments on commit 0a29121

Please sign in to comment.