diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2009-11-20 19:53:48 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2009-11-20 19:53:48 +0000 |
commit | 4ef99b69bf014d180f351b777160bb2ef67c11a3 (patch) | |
tree | 88933390dad084dad382012a1d71498dcadf5b19 /TAO/tao | |
parent | ea0d23aa0bed0037be6c14dd48e134e925c9ad14 (diff) | |
download | ATCD-4ef99b69bf014d180f351b777160bb2ef67c11a3.tar.gz |
Fri Nov 20 19:52:15 UTC 2009 Abdullah Sowayan <sowayan@gmail.com>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/VarOut_T.h | 5 | ||||
-rw-r--r-- | TAO/tao/VarOut_T.inl | 27 |
2 files changed, 8 insertions, 24 deletions
diff --git a/TAO/tao/VarOut_T.h b/TAO/tao/VarOut_T.h index 9c3d434ce72..358d7371b26 100644 --- a/TAO/tao/VarOut_T.h +++ b/TAO/tao/VarOut_T.h @@ -44,6 +44,7 @@ public: const T * operator-> (void) const; operator const T & () const; + operator T & (); operator T & () const; typedef const T & _in_type; @@ -84,9 +85,6 @@ public: // Fixed-size types only. TAO_Fixed_Var_T & operator= (const T &); - // Fixed-size types only. - operator T & (); - typedef T & _out_type; typedef T _retn_type; @@ -115,7 +113,6 @@ public: // Variable size types only. operator T *& (); - operator T & (); typedef T *& _out_type; typedef T * _retn_type; diff --git a/TAO/tao/VarOut_T.inl b/TAO/tao/VarOut_T.inl index c855db5ccf8..3f7bc1c5450 100644 --- a/TAO/tao/VarOut_T.inl +++ b/TAO/tao/VarOut_T.inl @@ -48,6 +48,13 @@ TAO_Var_Base_T<T>::operator const T & () const template<typename T> ACE_INLINE +TAO_Var_Base_T<T>::operator T & () +{ + return *this->ptr_; +} + +template<typename T> +ACE_INLINE TAO_Var_Base_T<T>::operator T & () const { return *this->ptr_; @@ -114,19 +121,6 @@ TAO_Fixed_Var_T<T>::operator= (T * p) return *this; } -template<typename T> -ACE_INLINE -TAO_Fixed_Var_T<T>::operator T & () -{ - // Use plain new, using the ACE_NEW macros will mean we dereference a - // nil pointer and crash which is more bad then plain new which could - // lead to a bad_alloc exception - if (this->ptr_ == 0) - this->ptr_ = new T; - - return *this->ptr_; -} - // Mapping for fixed size. template<typename T> ACE_INLINE @@ -187,13 +181,6 @@ TAO_Var_Var_T<T>::operator T *& () return this->ptr_; } -template<typename T> -ACE_INLINE -TAO_Var_Var_T<T>::operator T & () -{ - return *this->ptr_; -} - // Mapping for variable size. template<typename T> ACE_INLINE |