29 May
2016
29 May
'16
12:31 p.m.
On 5/29/2016 8:10 AM, Tan, Tom (Shanghai) wrote:
The following snippet does not compile with VS2015 and boost 1.61. What should the correct way to do it? Thanks.
// compile with cl.exe /EHSc
#define BOOST_TEST_MODULE pair
#include
std::pair
v() {
return std::make_pair(0, 0);
}
BOOST_AUTO_TEST_CASE(range)
{
BOOST_TEST(std::make_pair(0, 0) == v());
}
Here’s the error message:
C:\3rd\boost_1_61_0\boost/test/tools/assertion.hpp(163): error C2678: binary '==': no operator found which takes a left-hand operand of type 'std::pair
' (or there is no acceptable conversion)
std::make_pair(0,0) returns a value with the type std::pair