c++ - google test EXPECT_EQ and boost::make_recursive_variant -


I have a recursive variation as the following when I compare it using two recurring version object, it works fine Does, but with EXPECT_EQ, this gives the compilation error.

  typedef boost :: make_recursive_variant & lt; Bool, boost :: uint8_t, boost :: uint32_t, boost :: int32_t, double, std :: string, boost :: uuids :: uuid & gt; :: type rvariant_type; Variant_type b1 = true; Rvariant_type b2 = true; Emphasis (B1 == B2); // work fine EXPECT_EQ (B1, B2); // Compiler error returns EXPECT_EQ (boost :: get & gt; ball & gt; (b1), boost :: get & lt; balls & gt; (b2)); // work fine   

boost / v1.46.1 / include / boost / variant / detail / variant_io.hpp: 64: error: any match for an operator

Heavy use of streams for guest output but it seems that boost: Overloaded operator Version Support for Printing via Media & lt; & Lt; Very limited, if no one is non-existent.

Take a look at this:

  #include & lt; Boost / variant.hpp & gt; # Include & lt; Boost / cstdint.hpp & gt; # Include & lt; Boost / uuid / uuid.hpp & gt; # Include & lt; Iostream & gt; Typedef boost :: make_recursive_variant & lt; Bool, boost :: uint8_t, boost :: uint32_t, boost :: int32_t, double, std :: string, boost :: uuids :: uuid & gt; :: type rvariant_type; Int main () {rvariant_type v1 = true; Std :: cout & lt; & Lt; V1 & lt; & Lt; Std :: endl; Return 0; }   

This very small program gives you a similar compilation error that you obtained from GETT.

Supplement it with:

  std:: ostream & amp; Operator & lt; & Lt; (Std :: ostream & outside, const rvariant_type & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; & Lt; & Lt; To promote: get & lt; Bool & gt; (P); }   

I compile my test, I see a look that I can also work your example.

Update: I & lt; ;, Then the lack of an operator & lt; & Lt ;, compiled and successfully ran a test based on your code; Okay, what was the reason for this.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -