Opened 7 years ago

Closed 7 years ago

#11579 closed Bugs (duplicate)

boost.log version 1.59 stream operator failure for user types

Reported by: Marios Visvardis <visvardis.marios@…> Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.59.0 Severity: Regression
Keywords: Cc: visvardis.marios@…

Description

The following code works as expected with boost 1.57, but fails with boost 1.59:

#include <iostream> #include <boost/log/trivial.hpp>

struct Foo {

int d=1;

};

std::ostream& operator<<(std::ostream& out, const Foo& foo) {

out << "Foo: " << foo.d; return out;

}

int main() {

BOOST_LOG_TRIVIAL(info) << Foo(); return EXIT_SUCCESS;

}

I have also started a discussion in SO:

http://stackoverflow.com/questions/32185858/problems-with-boost-log-version-1-59/32187641#32187641

and a workaround is suggested.

Change History (2)

comment:1 by Marios Visvardis <visvardis.marios@…>, 7 years ago

Cc: visvardis.marios@… added

comment:2 by Andrey Semashev, 7 years ago

Resolution: duplicate
Status: newclosed

Duplicates #11549.

Note: See TracTickets for help on using tickets.