R
ravajappa.gouda
Hi! Can somebody tell me when does copy constructor 1 or 2 gets called
in a template class below? And if you can explain the difference
between the 1 and 2 below would be great?
template<typename T, size_t size>
class container {
public:
container() //default constructor.
{
}
template<typename cT, size_t cs> // Copy
constructor 1
container(const container<cT, cs>& rhs)
{
........
}
container(const container& rhs) // Copy
constructor 2
{
...........
}
private: ..... //
private members defined here.
};
in a template class below? And if you can explain the difference
between the 1 and 2 below would be great?
template<typename T, size_t size>
class container {
public:
container() //default constructor.
{
}
template<typename cT, size_t cs> // Copy
constructor 1
container(const container<cT, cs>& rhs)
{
........
}
container(const container& rhs) // Copy
constructor 2
{
...........
}
private: ..... //
private members defined here.
};