diff options
Diffstat (limited to 'TAO/tao/Array_VarOut_T.inl')
-rw-r--r-- | TAO/tao/Array_VarOut_T.inl | 62 |
1 files changed, 18 insertions, 44 deletions
diff --git a/TAO/tao/Array_VarOut_T.inl b/TAO/tao/Array_VarOut_T.inl index f0837b64e71..b1b38964d53 100644 --- a/TAO/tao/Array_VarOut_T.inl +++ b/TAO/tao/Array_VarOut_T.inl @@ -2,6 +2,8 @@ // //$Id$ +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + template<typename T, typename T_slice, typename TAG> ACE_INLINE TAO_Array_Var_Base_T<T,T_slice,TAG>::TAO_Array_Var_Base_T (void) @@ -223,18 +225,18 @@ TAO_Array_Out_T<T,T_var,T_slice,TAG>::operator T_slice *& () template<typename T, typename T_var, typename T_slice, typename TAG> ACE_INLINE -T_slice *& -TAO_Array_Out_T<T,T_var,T_slice,TAG>::ptr (void) +T_slice & +TAO_Array_Out_T<T,T_var,T_slice,TAG>::operator[] (CORBA::ULong index) { - return this->ptr_; + return this->ptr_[index]; } template<typename T, typename T_var, typename T_slice, typename TAG> ACE_INLINE -T_slice & -TAO_Array_Out_T<T,T_var,T_slice,TAG>::operator[] (CORBA::ULong index) +T_slice *& +TAO_Array_Out_T<T,T_var,T_slice,TAG>::ptr (void) { - return this->ptr_[index]; + return this->ptr_; } // ************************************************************* @@ -243,7 +245,7 @@ template<typename T, typename T_slice, typename TAG> ACE_INLINE TAO_Array_Forany_T<T,T_slice,TAG>::TAO_Array_Forany_T (void) : ptr_ (0), - nocopy_ (0) + nocopy_ (false) {} template<typename T, typename T_slice, typename TAG> @@ -312,24 +314,8 @@ ACE_INLINE const T_slice & TAO_Array_Forany_T<T,T_slice,TAG>::operator[] (CORBA::ULong index) const { -#if defined (ACE_HAS_BROKEN_IMPLICIT_CONST_CAST) -# if defined (_MSC_VER) && _MSC_VER <= 1200 - // @@ (OO) MSVC++ 6 can't handle the const_cast<> in the - // multi-dimensional array case so reinterpret_cast<> cast - // instead. It's not clear if this is really the right - // thing to do but the code won't compile with MSVC++ 6 - // without it. We use a reinterpret_cast<> instead of a - // C-style "sledgehammer" cast to make it obvious that this - // code may have unresolved issues, and also to make it - // easier for others to find this code. - return reinterpret_cast<const T_slice &> (this->ptr_[index]); -# else - return const_cast<const T_slice &> (this->ptr_[index]); -# endif /* _MSC_VER <= 1200 */ -#else const T_slice & tmp = this->ptr_[index]; return tmp; -#endif /* ACE_HAS_BROKEN_IMPLICIT_CONST_CAST */ } template<typename T, typename T_slice, typename TAG> @@ -345,21 +331,7 @@ ACE_INLINE const T_slice * TAO_Array_Forany_T<T,T_slice,TAG>::in (void) const { - // @@@ (JP) This looks scary I know but it helps MSVC understand - // things better when the array is multi-dimensional. -#if (defined (_MSC_VER) && _MSC_VER <= 1200) || (defined (__IBMCPP__) && (__IBMCPP__ <= 600)) - // @@ (OO) MSVC++ 6 can't handle the const_cast<> in the - // multi-dimensional array case so reinterpret_cast<> cast - // instead. It's not clear if this is really the right - // thing to do but the code won't compile with MSVC++ 6 - // without it. We use a reinterpret_cast<> instead of a - // C-style "sledgehammer" cast to make it obvious that this - // code may have unresolved issues, and also to make it - // easier for others to find this code. - return reinterpret_cast<const T_slice *> (this->ptr_); -#else - return const_cast<const T_slice *> (this->ptr_); -#endif /* _MSC_VER <= 1200 */ + return this->ptr_; } template<typename T, typename T_slice, typename TAG> @@ -388,18 +360,18 @@ TAO_Array_Forany_T<T,T_slice,TAG>::_retn (void) template<typename T, typename T_slice, typename TAG> ACE_INLINE -T_slice * -TAO_Array_Forany_T<T,T_slice,TAG>::ptr (void) const +CORBA::Boolean +TAO_Array_Forany_T<T,T_slice,TAG>::nocopy (void) const { - return this->ptr_; + return this->nocopy_; } template<typename T, typename T_slice, typename TAG> ACE_INLINE -CORBA::Boolean -TAO_Array_Forany_T<T,T_slice,TAG>::nocopy (void) const +T_slice * +TAO_Array_Forany_T<T,T_slice,TAG>::ptr (void) const { - return this->nocopy_; + return this->ptr_; } template<typename T, typename T_slice, typename TAG> @@ -409,3 +381,5 @@ TAO_Array_Forany_T<T,T_slice,TAG>::tao_alloc (void) { return TAO::Array_Traits<T,T_slice,TAG>::alloc (); } + +TAO_END_VERSIONED_NAMESPACE_DECL |