473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
1 1294
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
4
by: Brian Barnes | last post by:
I am trying to create a template code behind file for a website which all pages should be inherited from. This base class however, when I try to view the aspx page in Visual studio .NET (2002), it...
6
by: Neal | last post by:
Hi All, I used an article on XSLT and XML and creating a TOC written on the MSDN CodeCorner. ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncodecorn/html/corner042699.htm However, it did'nt...
7
by: mathieu | last post by:
Hello, I did read the FAQ on template(*), since I could not find an answer to my current issue I am posting here. I have tried to summarize my issue in the following code (**). Basically I am...
45
by: charles.lobo | last post by:
Hi, I have recently begun using templates in C++ and have found it to be quite useful. However, hearing stories of code bloat and assorted problems I decided to write a couple of small programs...
6
by: Bartholomew Simpson | last post by:
I'm trying to avoid (or at least, minimize) duplicity of effort. I have the following function: void Permissions::Exists(const unsigned int id, std::vector<Permission>::const_iterator& iter) {...
8
by: Rahul | last post by:
Hi, Is there a way to partially specialize only a member function of a template class (not the whole class). e.g. template <typename A, typename B> class Base { public:
9
by: stephen.diverdi | last post by:
Can anyone lend a hand on getting this particular template specialization working? I've been trying to compile with g++ 4.1 and VS 2005. ...
21
by: H9XLrv5oXVNvHiUI | last post by:
Hi, I have a question about injecting friend functions within template classes. My question is specific to gcc (version 3.4.5) used in combination with mingw because this code (or at least code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.