diff options
Diffstat (limited to 'src/test/test_bitcoin.h')
-rw-r--r-- | src/test/test_bitcoin.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h index 3872767133..182571b004 100644 --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -15,9 +15,17 @@ #include <txmempool.h> #include <memory> +#include <type_traits> #include <boost/thread.hpp> +// Enable BOOST_CHECK_EQUAL for enum class types +template <typename T> +std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream, const T& e) +{ + return stream << static_cast<typename std::underlying_type<T>::type>(e); +} + extern uint256 insecure_rand_seed; extern FastRandomContext insecure_rand_ctx; |