By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

Copying a template class into another template class object with different no of templates

P: n/a
hi

Suppose i have a template class
template <class V, class I=int, class S=FullMatrix<V where the
FullMatrix is another template object.
class matrix

I will like to either create a constructor or add a function which
copies from another template class with only
template<class V>
class matrixsub

such that a new matrix object is created.

The class I and S can be populated by default types.

Does anyone know how to do it? I am a loss how to start in the 1st
place, so do not have any sample code.

Eric

Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
er*********@gmail.com wrote:
hi

Suppose i have a template class
template <class V, class I=int, class S=FullMatrix<V where the
FullMatrix is another template object.
class matrix

I will like to either create a constructor or add a function which
copies from another template class with only
template<class V>
class matrixsub

such that a new matrix object is created.

The class I and S can be populated by default types.

Does anyone know how to do it? I am a loss how to start in the 1st
place, so do not have any sample code.

Eric
You mean this? I'm not quite sure from your description.

template <class V, class I=int, class S=FullMatrix<V
class matrix
{
public:
matrix(const matrixsub<V>& s);
...
};

john
Feb 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.