]> git.lyx.org Git - features.git/commitdiff
msvc: Move implementation of numpunct<> functions to cpp file
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 20 Oct 2015 19:23:01 +0000 (21:23 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 20 Oct 2015 19:28:40 +0000 (21:28 +0200)
These functions use lyx::from_ascii which means they need to include
docstring.h, but that results in a circular include.

src/support/docstream.cpp
src/support/numpunct_lyx_char_type.h

index f6548e139fccccbeb50286a6c156d2781aa7cf02..b07ac56a320dea157d5723e8214ea4a9aac1e12c 100644 (file)
@@ -28,7 +28,24 @@ using lyx::ucs4_codeset;
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
 std::locale::id numpunct<lyx::char_type>::id;
-#endif
+
+namespace std {
+// Implementation of numpunct<lyx::char_type> defined in numpunct_lyx_char_type.h
+typedef basic_string<lyx::char_type> string_type;
+       
+string_type numpunct<lyx::char_type>::truename() const
+{ 
+       return lyx::from_ascii(numpunct<char>::truename()); 
+}
+       
+string_type numpunct<lyx::char_type>::falsename() const
+{ 
+       return lyx::from_ascii(numpunct<char>::falsename()); 
+}
+
+} // namespace std
+
+#endif // _MSC_VER >= 1600
 
 
 namespace {
index 6ef22e61e4f7f375fb2b0720af4fb3cbb60526c7..b3f6cdea28403697c17f734e7148e4462c5607a4 100644 (file)
@@ -41,11 +41,9 @@ namespace std
                string grouping() const
                { return numpunct<char>::grouping(); }
 
-               string_type truename() const
-               { return lyx::from_ascii(numpunct<char>::truename()); }
-
-               string_type falsename() const
-               { return lyx::from_ascii(numpunct<char>::falsename()); }
+               // Implementation can be found in docstream.cpp
+               string_type truename() const;
+               string_type falsename() const;
 
 
        protected: