: Logger(helper.Logger)
, Level(helper.Level)
, Location(helper.Location)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+, StreamPtr(std::move(helper.StreamPtr))
+#else
, StreamPtr(helper.StreamPtr)
+#endif
{
} // eo PartLogger::LogHelper::LogHelper(const LogHelper&)
#include <exception>
#include <stdexcept>
+/*
+** std::unique_ptr is available in GCC 4.4, but to be safe
+** we use std::auto_ptr for GCC 4.4.x and std::unique_ptr for GCC 4.8.1+.
+** GCC 4.8.1 was the first version with feature-complete C++11 support.
+** See: https://gcc.gnu.org/projects/cxx-status.html#cxx11
+*/
+#include <memory>
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+#if __cplusplus < 201103L
+#error "This header requires C++11 or higher when compiled with GCC >= 4.8. " \
+"Otherwise we get an ABI mismatch."
+#endif
+typedef std::unique_ptr< std::ostringstream > StreamPtrType;
+#else
+typedef std::auto_ptr< std::ostringstream > StreamPtrType;
+#endif
+
#include <boost/shared_ptr.hpp>
#include "source_track_basics.hpp"
PartLogger& Logger;
int Level;
SourceLocation Location;
- mutable std::auto_ptr< std::ostringstream > StreamPtr;
+ mutable StreamPtrType StreamPtr;
}; // eo class LogHelper