]> git.lyx.org Git - features.git/commitdiff
Gcc 4.6 compatibility :(
authorGuillaume Munch <gm@lyx.org>
Thu, 22 Sep 2016 23:42:57 +0000 (01:42 +0200)
committerGuillaume Munch <gm@lyx.org>
Sun, 16 Oct 2016 22:16:59 +0000 (00:16 +0200)
src/TexRow.h
src/texstream.cpp

index 3ca51724f871aaac21f73d264aa0bb06c58e6d9b..382d566a76ccba2a7095a2b0b7f9f7f696a2425c 100644 (file)
@@ -89,6 +89,7 @@ public:
        ///
        TexRow();
 
+#if !(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
        /// Copy can be expensive and is not usually useful for TexRow.
        /// Force explicit copy, prefer move instead. This also prevents
        /// move()s from being converted into copy silently.
@@ -96,6 +97,10 @@ public:
        TexRow(TexRow && other) = default;
        TexRow & operator=(TexRow const & other) = default;
        TexRow & operator=(TexRow && other) = default;
+# else
+       //for gcc 4.6, nothing to do: it's enough to disable implicit copy during
+       // dev with more recent versions of gcc.
+#endif
 
        /// Clears structure.
        void reset();
@@ -204,6 +209,7 @@ struct TexString {
        docstring str;
        ///
        TexRow texrow;
+#if !(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
        /// Copy can be expensive and is not usually useful for TexString.
        /// Force explicit copy, prefer move instead. This also prevents
        /// move()s from being converted into copy silently.
@@ -211,6 +217,10 @@ struct TexString {
        TexString(TexString && other) = default;
        TexString & operator=(TexString const & other) = default;
        TexString & operator=(TexString && other) = default;
+# else
+       //for gcc 4.6, nothing to do: it's enough to disable implicit copy during
+       // dev with more recent versions of gcc.
+#endif
        ///
        TexString() = default;
        /// ensure that the string and the TexRow have as many newlines.
index be1168a7e815e5536bdda3f5b083830060b6d660..eb1834b5de74e84486f429025347fde7592f6828 100644 (file)
@@ -80,7 +80,8 @@ TexString otexstringstream::release()
 {
        TexString ts{ods_.str(), TexRow()};
        swap(ts.texrow, texrow());
-       ods_ = odocstringstream();
+       ods_.clear();
+       ods_.str(docstring());
        return ts;
 }