5 #ifndef BITCOIN_TEST_UTIL_COMMON_H 6 #define BITCOIN_TEST_UTIL_COMMON_H 22 bool operator()(
const std::exception& e)
const {
return (*
this)(e.what()); }
30 template <
typename T> requires std::is_enum_v<T>
31 inline std::ostream&
operator<<(std::ostream& os,
const T& e)
33 return os << static_cast<std::underlying_type_t<T>>(e);
37 inline std::ostream& operator<<(std::ostream& os, const std::optional<T>& v)
40 : os <<
"std::nullopt";
47 template <HasToString T>
48 inline std::ostream&
operator<<(std::ostream& os,
const T& obj)
50 return os << obj.ToString();
55 #endif // BITCOIN_TEST_UTIL_COMMON_H bool operator()(std::string_view s) const
requires std::is_enum_v< T > std::ostream & operator<<(std::ostream &os, const T &e)
HasReason(std::string_view reason)
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
std::ostream & operator<<(std::ostream &os, const T &obj)
bool operator()(const std::exception &e) const
const std::string m_reason