- workaround for older gcc versions (<4.6) sometimes copying temporaries even though they shouldn't.

pull/30/head
Alexander Gessler 2013-04-13 16:08:13 +02:00
parent afe1dd8c02
commit 17e2588588
1 changed files with 13 additions and 0 deletions

View File

@ -90,6 +90,19 @@ public:
underlying << sin;
}
// The problem described here:
// https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462
// can also cause trouble here. Apparently, older gcc versions sometimes copy temporaries
// being bound to const ref& function parameters. Copying streams is not permitted, though.
// This workaround avoids this by manually specifying a copy ctor.
#if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
basic_formatter(const basic_formatter& other) {
underlying << (string)other;
}
#endif
public:
operator string () const {