Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting boost_test_print_type does not work when testing a type with an explicit conversion to bool #158

Closed
Marc-Aldorasi-Imprivata opened this issue Sep 11, 2018 · 1 comment

Comments

@Marc-Aldorasi-Imprivata
struct s {
	explicit operator bool() const { return false; }
};
std::ostream &boost_test_print_type(std::ostream &o, const s &) { return o << 's'; }

When testing a value of type s (e.g. BOOST_TEST(s{})), compilation fails because the compiler is looking for an overload of operator<<, but we haven't provided one. As per the documentation, providing a definition of boost_test_print_type should be sufficient.

raffienficiaud added a commit that referenced this issue Sep 23, 2018
…alue' into next-internal

* topic/GH-158-boost_test_print_type-printing-on-single-value:
  Change log
  Unary expression: fixing the printing issue
raffienficiaud added a commit that referenced this issue Sep 25, 2018
…alue' into next-internal

* topic/GH-158-boost_test_print_type-printing-on-single-value:
  Change log
  Unary expression: fixing the printing issue
@raffienficiaud
Copy link
Member

See #159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants