formula: make operator bool explicit

* spot/tl/formula.hh (formula::operator bool): Make it explicit.  When
compiling in C++20 mode with g++ 10.1, this bool operator was used
instead of the comparison operators while looking up a
std::pair<formula,formula> in a hash map, causing many test suite
failures.  This problem does not occur with clang++ 10.0, so it
might just be a bug in g++ 10.1.  But having explicit operator bool
is good practice anyway.
This commit is contained in:
Alexandre Duret-Lutz 2020-07-17 11:39:55 +02:00
parent a8959ecf81
commit 9daa4e60a4

View file

@ -842,7 +842,7 @@ namespace spot
return ptr_ != nullptr; return ptr_ != nullptr;
} }
operator bool() const noexcept explicit operator bool() const noexcept
{ {
return ptr_ != nullptr; return ptr_ != nullptr;
} }