Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / VarOut_T.cpp
blobb04e5a9b0b9f847dfa3b265ab9bb6c7578101053
1 #ifndef TAO_VAROUT_T_CPP
2 #define TAO_VAROUT_T_CPP
4 #include "tao/VarOut_T.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/VarOut_T.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename T>
13 TAO_Var_Base_T<T>::TAO_Var_Base_T (const TAO_Var_Base_T<T> & p)
14 : ptr_ (p.ptr_ ? new T (*p.ptr_) : nullptr)
18 // *************************************************************
20 template<typename T>
21 TAO_Fixed_Var_T<T> &
22 TAO_Fixed_Var_T<T>::operator= (const TAO_Fixed_Var_T<T> & p)
24 // Strongly exception safe assignment using copy and non-throwing
25 // swap technique.
26 TAO_Fixed_Var_T<T> tmp (p);
28 T * old_ptr = this->ptr_;
29 this->ptr_ = tmp.ptr_;
30 tmp.ptr_ = old_ptr;
32 return *this;
35 // Fixed-size types only.
36 template<typename T>
37 TAO_Fixed_Var_T<T> &
38 TAO_Fixed_Var_T<T>::operator= (const T & p)
40 // Strongly exception safe assignment using copy and non-throwing
41 // swap technique.
42 TAO_Fixed_Var_T<T> tmp (p);
44 T * old_ptr = this->ptr_;
45 this->ptr_ = tmp.ptr_;
46 tmp.ptr_ = old_ptr;
48 return *this;
51 // *************************************************************
53 template<typename T>
54 TAO_Var_Var_T<T> &
55 TAO_Var_Var_T<T>::operator= (const TAO_Var_Var_T<T> & p)
57 // Strongly exception safe assignment using copy and non-throwing
58 // swap technique.
59 TAO_Var_Var_T<T> tmp (p);
61 T * old_ptr = this->ptr_;
62 this->ptr_ = tmp.ptr_;
63 tmp.ptr_ = old_ptr;
65 return *this;
68 TAO_END_VERSIONED_NAMESPACE_DECL
70 #endif /* TAO_VAROUT_T_CPP */