mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 16:17:54 +02:00
test: Allow time_point in boost checks
This is required in the next commit.
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
#ifndef BITCOIN_TEST_UTIL_COMMON_H
|
||||
#define BITCOIN_TEST_UTIL_COMMON_H
|
||||
|
||||
#include <ostream>
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,12 @@ private:
|
||||
|
||||
// Make types usable in BOOST_CHECK_* @{
|
||||
namespace std {
|
||||
template <typename Clock, typename Duration>
|
||||
inline std::ostream& operator<<(std::ostream& os, const std::chrono::time_point<Clock, Duration>& tp)
|
||||
{
|
||||
return os << tp.time_since_epoch().count();
|
||||
}
|
||||
|
||||
template <typename T> requires std::is_enum_v<T>
|
||||
inline std::ostream& operator<<(std::ostream& os, const T& e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user