If "a" and "b" are of type stdx::optional<T>, then the test assertion "REQUIRE(a == b);" may not compile under certain configurations.
Specifically, on the driver's current Windows CI hosts (which use use Boost polyfills for stdx), these statements fail to compile with the following error:
error C2338: If you want to output boost::optional, include header <boost/optional/optional_io.hpp>
This is due to the fact that Catch attempts to convert comparison operands to strings with
operator<<(), in case of an assertion failure.
After pulling in optional_io.hpp, the following error is still generated for certain types, even types that Catch is normally perfectly happy to normally include in REQUIRE() comparison statements (like enum class types):
error C2679: binary '<<': no operator found which takes a right-hand operand of type 'T' (or there is no acceptable conversion)
We should come up with some sort of solution that makes it legal to compare objects of type stdx::optional<T> in test cases whenever it is legal to compare objects of type T.
- duplicates
-
CXX-1537 Upgrade Catch from 1.9.4 to 2.2.1
- Closed