Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tao / Seq_Var_T.cpp
blobf3c27e5b3c37434458413c8fb274a4e1e55bb04b
1 #ifndef TAO_SEQ_VAR_T_CPP
2 #define TAO_SEQ_VAR_T_CPP
4 #include "tao/Seq_Var_T.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/Seq_Var_T.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename T>
13 TAO_Seq_Var_Base_T<T>::TAO_Seq_Var_Base_T (const TAO_Seq_Var_Base_T<T> & p)
14 : ptr_ (p.ptr_ ? new T (*p.ptr_) : nullptr)
18 // ****************************************************************************
20 template<typename T>
21 TAO_FixedSeq_Var_T<T> &
22 TAO_FixedSeq_Var_T<T>::operator= (const TAO_FixedSeq_Var_T<T> & p)
24 // Strongly exception safe assignment using copy and non-throwing
25 // swap technique.
26 TAO_FixedSeq_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_FixedSeq_Var_T<T> &
38 TAO_FixedSeq_Var_T<T>::operator= (const T & p)
40 // Strongly exception safe assignment using copy and non-throwing
41 // swap technique.
42 TAO_FixedSeq_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_VarSeq_Var_T<T> &
55 TAO_VarSeq_Var_T<T>::operator= (const TAO_VarSeq_Var_T<T> & p)
57 // Strongly exception safe assignment using copy and non-throwing
58 // swap technique.
59 TAO_VarSeq_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_SEQ_VAR_T_CPP */