You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by vi...@apache.org on 2008/07/22 22:49:11 UTC
svn commit: r678894 - /stdcxx/branches/4.3.x/include/rw/_meta_prop.h
Author: vitek
Date: Tue Jul 22 13:49:11 2008
New Revision: 678894
URL: http://svn.apache.org/viewvc?rev=678894&view=rev
Log:
2008-07-22 Travis Vitek <vi...@roguewave.com>
STDCXX-1002
* include/rw/_meta_prop.h [__SUNPRO_CC]: Work around sunpro-5.9
detecting cv-qualifiers on array types.
Modified:
stdcxx/branches/4.3.x/include/rw/_meta_prop.h
Modified: stdcxx/branches/4.3.x/include/rw/_meta_prop.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_meta_prop.h?rev=678894&r1=678893&r2=678894&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_prop.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_prop.h Tue Jul 22 13:49:11 2008
@@ -45,18 +45,71 @@
template <> struct Trait<Type const volatile> : __rw_true_type { }
+#if defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x590)
+
template <class _TypeT>
-struct __rw_is_const : __rw_false_type
+struct __rw_is_const_impl
{
+ struct _C_no { };
+ struct _C_yes { _C_no __pad [2]; };
+
+ template <class _TypeU>
+ struct _C_nest { };
+
+ template <class _TypeU>
+ static _C_yes _C_test (_C_nest<const _TypeU>*);
+
+ template <class _TypeU>
+ static _C_no _C_test (_C_nest<_TypeU>*);
+
+ enum { _C_value =
+ sizeof (_C_test ((_C_nest<_TypeT>*)0)) == sizeof (_C_yes)
+ };
};
template <class _TypeT>
-struct __rw_is_const<const _TypeT> : __rw_true_type
+struct __rw_is_const
+ : __rw_integral_constant<bool, __rw_is_const_impl<_TypeT>::_C_value>
{
};
-#define _RWSTD_IS_CONST(T) _RW::__rw_is_const<T>::value
+template <class _TypeT>
+struct __rw_is_volatile_impl
+{
+ struct _C_no { };
+ struct _C_yes { _C_no __pad [2]; };
+ template <class _TypeU>
+ struct _C_nest { };
+
+ template <class _TypeU>
+ static _C_yes _C_test (_C_nest<volatile _TypeU>*);
+
+ template <class _TypeU>
+ static _C_no _C_test (_C_nest<_TypeU>*);
+
+ enum { _C_value =
+ sizeof (_C_test ((_C_nest<_TypeT>*)0)) == sizeof (_C_yes)
+ };
+};
+
+template <class _TypeT>
+struct __rw_is_volatile
+ : __rw_integral_constant<bool, __rw_is_volatile_impl<_TypeT>::_C_value>
+{
+};
+
+#else
+
+template <class _TypeT>
+struct __rw_is_const : __rw_false_type
+{
+};
+
+template <class _TypeT>
+struct __rw_is_const<const _TypeT> : __rw_true_type
+{
+};
template <class _TypeT>
struct __rw_is_volatile : __rw_false_type
@@ -68,6 +121,9 @@
{
};
+#endif
+
+#define _RWSTD_IS_CONST(T) _RW::__rw_is_const<T>::value
#define _RWSTD_IS_VOLATILE(T) _RW::__rw_is_volatile<T>::value