]> git.lyx.org Git - features.git/blobdiff - src/support/strfwd.h
Make trivstring class ready for use
[features.git] / src / support / strfwd.h
index de8588cabce30c8517d48fb5132bd4d42dc7707a..94f2136403c121d25bf09ebd94eeb199426a2322 100644 (file)
@@ -17,7 +17,7 @@
 // if libc++ is used (rather than libstdc++) - we first
 // check if we have at least a c++03 standard before
 // including the file
-#if (__cplusplus > 19971L)
+#if (__cplusplus > 199711L)
 #include <ciso646>
 #endif
 
@@ -68,7 +68,11 @@ typedef basic_ostringstream<char, char_traits<char>, allocator<char> > ostringst
 
 namespace lyx {
 
-/// String type for storing the main text in UCS4 encoding
+/**
+ * String type for storing the main text in UCS4 encoding.
+ * Use std::string only in cases 7-bit ASCII is to be manipulated
+ * within the variable.
+ */
 typedef std::basic_string<char_type, std::char_traits<char_type>,
        std::allocator<char_type> > docstring;
 
@@ -91,6 +95,15 @@ std::string const & empty_string();
 // defined in docstring.cpp
 bool operator==(docstring const &, char const *);
 
+#ifdef STD_STRING_USES_COW
+template<typename Char> class trivial_string;
+typedef trivial_string<char> trivstring;
+typedef trivial_string<char_type> trivdocstring;
+#else
+typedef std::string trivstring;
+typedef docstring trivdocstring;
+#endif
+
 } // namespace lyx
 
 #endif