stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elemi...@apache.org
Subject svn commit: r659278 - /stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
Date Thu, 22 May 2008 22:11:07 GMT
Author: elemings
Date: Thu May 22 15:11:07 2008
New Revision: 659278

URL: http://svn.apache.org/viewvc?rev=659278&view=rev
Log:
2008-05-22  Eric Lemings <eric.lemings@roguewave.com>

	STDCXX-905
	* tests/localization/22.locale.synopsis.cpp: Fix HP aCC compile
	error by moving UDC type and collate<UDC> specialization just
	before first template instantiation in test_locale() function.


Modified:
    stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp

Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp?rev=659278&r1=659277&r2=659278&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp Thu May 22 15:11:07 2008
@@ -472,6 +472,61 @@
 };
 
 
+_RWSTD_NAMESPACE (std) {
+
+// user-defined character type; used to exercise requirements in Table 52
+// i.e., specializations of facets on types other than char and wchar_t
+#define UDC int
+
+// class template specialization for UDC type
+_RWSTD_SPECIALIZED_CLASS
+struct collate<UDC>: locale::facet
+{
+    typedef UDC                                 char_type;
+    typedef StringTypes<char_type>::string_type string_type;
+
+    typedef locale::facet                       Base;
+
+    _EXPLICIT collate (size_t refs = 0)
+        : Base (refs) { /* empty */ }
+
+    static locale::id                           id;
+
+    int
+    compare (const char_type* begin1, const char_type* end1,
+             const char_type* begin2, const char_type* end2) const {
+        return do_compare (begin1, end1, begin2, end2) ;
+    }
+
+protected:
+
+    // define (no-op) virtual functions for UDC type
+    virtual int
+    do_compare (const char_type*, const char_type*,
+                const char_type*, const char_type*) const
+    {
+        return int ();
+    }
+
+    virtual string_type
+    do_transform (const char_type*, const char_type*) const
+    {
+        return string_type ();
+    }
+
+
+    virtual long
+    do_hash (const char_type*, const char_type*) const
+    {
+        return long ();
+    }
+};
+
+locale::id collate<UDC>::id;
+
+}   // namespace std
+
+
 // test class locale definition
 static void
 test_locale ()
@@ -1055,10 +1110,6 @@
 
 /***************************************************************************/
 
-// user-defined character type; used to exercise requirements in Table 52
-// i.e., specializations of facets on types other than char and wchar_t
-#define UDC int
-
 // numeric category
 
 namespace std {
@@ -1342,53 +1393,6 @@
 
 // collate category
 
-_RWSTD_NAMESPACE (std) {
-
-// class template specialization for UDC type
-_RWSTD_SPECIALIZED_CLASS
-struct collate<UDC>: locale::facet
-{
-    typedef UDC                 char_type;
-    typedef basic_string<UDC>   string_type;
-
-    static locale::id           id;
-
-    int
-    compare (const char_type* begin1, const char_type* end1,
-             const char_type* begin2, const char_type* end2) const {
-        return do_compare (begin1, end1, begin2, end2) ;
-    }
-
-protected:
-
-    // define (no-op) virtual functions for UDC type
-    virtual int
-    do_compare (const char_type*, const char_type*,
-                const char_type*, const char_type*) const
-    {
-        return int ();
-    }
-
-    virtual string_type
-    do_transform (const char_type*, const char_type*) const
-    {
-        return string_type ();
-    }
-
-
-    virtual long
-    do_hash (const char_type*, const char_type*) const
-    {
-        return long ();
-    }
-
-};
-
-locale::id collate<UDC>::id;
-
-}   // namespace std
-
-
 template <class charT>
 struct CollateDerived: std::collate<charT>
 {



Mime
View raw message