Add assignment

This commit is contained in:
Job Noorman
2022-10-27 12:29:19 +02:00
commit 9f05ab03c1
49 changed files with 4339 additions and 0 deletions

26
Tests/TestUtils.hpp Normal file
View File

@@ -0,0 +1,26 @@
#ifndef CHESS_ENGINE_TESTS_TESTUTILS_HPP
#define CHESS_ENGINE_TESTS_TESTUTILS_HPP
#include <optional>
#include <memory>
#include <ostream>
template<typename T>
inline std::ostream& operator<<(std::ostream& os, const std::optional<T>& opt) {
if (opt.has_value()) {
return os << opt.value();
} else {
return os << "nullopt";
}
}
template<typename T>
inline std::ostream& operator<<(std::ostream& os, const std::unique_ptr<T>& ptr) {
if (ptr == nullptr) {
return os << "nullptr";
} else {
return os << ptr.get();
}
}
#endif