Simplify asserts introduced in #512. (#513)

These are functionally equivalent but have the form A -> B (i.e. !A ||
B in C++).
This commit is contained in:
Robert Norton
2022-04-29 11:33:14 +01:00
committed by GitHub
parent 70eba1e70b
commit 3e08caaf32

View File

@@ -86,14 +86,12 @@ namespace snmalloc
{
static_assert(
!detail::has_domesticate<Backend, T, B>(0) ||
(detail::has_domesticate<Backend, T, B>(0) &&
Backend::Options.HasDomesticate),
Backend::Options.HasDomesticate,
"Back end provides domesticate function but opts out of using it ");
static_assert(
detail::has_domesticate<Backend, T, B>(0) ||
!(detail::has_domesticate<Backend, T, B>(0) &&
Backend::Options.HasDomesticate),
!Backend::Options.HasDomesticate,
"Back end does not provide capptr_domesticate and requests its use");
if constexpr (Backend::Options.HasDomesticate)
{