Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: serial link question (COM port on pC) Pin
valikac17-Aug-04 7:33
valikac17-Aug-04 7:33 
GeneralNeed help CListCtrl Pin
Metatron_17-Aug-04 6:47
Metatron_17-Aug-04 6:47 
GeneralRe: Need help CListCtrl Pin
Ravi Bhavnani17-Aug-04 7:21
professionalRavi Bhavnani17-Aug-04 7:21 
GeneralSTL problem Pin
BeerBelly17-Aug-04 6:25
BeerBelly17-Aug-04 6:25 
GeneralRe: STL problem Pin
Jeff Bogan17-Aug-04 7:18
Jeff Bogan17-Aug-04 7:18 
GeneralRe: STL problem Pin
digwizfox17-Aug-04 12:59
digwizfox17-Aug-04 12:59 
GeneralRe: STL problem Pin
Ryan Binns17-Aug-04 19:28
Ryan Binns17-Aug-04 19:28 
GeneralRe: STL problem Pin
digwizfox17-Aug-04 7:43
digwizfox17-Aug-04 7:43 
Something looks peculiar in your template class declaration. Vector is a template class. So you are specializing a template class. Shouldn't it be something like this?

template class <class t=""> VSet : public std::vector<class t="">
{
public:
void add(T pT);
};

That is how the examples that I have seen work. When you declar a template class, you have to put the generic type variable within <>. Also, the code that instantiates the vector (which I do not see in your example) will need to #include "pair.h" and instantiate the vector like below.


//Program needs to see the declaration of pair
#include "Pair.h"
#include "VSet.h"

//Instaniate the vector specialization
VSet<pair> p;

//Call the test function
TestFunc(&p);

Try something like that. If you have an STL book, search for some code examples using vectors so that you can see what I mean about declaring and instantiating a template class. I don't think your class declaration is correct.

I hope that will work for you but I haven't tested it. That information is basically right out of my C++ books. Obviously, the compiler doesn't know what a pair is so it can't know about the copy constructor and assignment operator. Also, you need the < class T > after the word template in your function definition as well. Try playing around with that and see if it works.
GeneralRe: STL problem Pin
Jeff Bogan17-Aug-04 9:36
Jeff Bogan17-Aug-04 9:36 
GeneralRe: STL problem Pin
digwizfox17-Aug-04 12:51
digwizfox17-Aug-04 12:51 
GeneralRe: STL problem Pin
peterchen17-Aug-04 10:56
peterchen17-Aug-04 10:56 
GeneralRe: STL problem Pin
BeerBelly17-Aug-04 19:02
BeerBelly17-Aug-04 19:02 
QuestionHow to Start With C++? Pin
Dody_DK17-Aug-04 6:13
Dody_DK17-Aug-04 6:13 
AnswerRe: How to Start With C++? Pin
Watever_417-Aug-04 6:23
Watever_417-Aug-04 6:23 
AnswerRe: How to Start With C++? Pin
Maximilien17-Aug-04 6:35
Maximilien17-Aug-04 6:35 
GeneralRe: How to Start With C++? Pin
Dody_DK17-Aug-04 6:39
Dody_DK17-Aug-04 6:39 
GeneralRe: How to Start With C++? Pin
Ravi Bhavnani17-Aug-04 7:28
professionalRavi Bhavnani17-Aug-04 7:28 
AnswerRe: How to Start With C++? Pin
valikac17-Aug-04 7:36
valikac17-Aug-04 7:36 
AnswerRe: How to Start With C++? Pin
peterchen17-Aug-04 11:38
peterchen17-Aug-04 11:38 
Questioncan a dll use the mfc? Pin
Anonymous17-Aug-04 6:06
Anonymous17-Aug-04 6:06 
AnswerRe: can a dll use the mfc? Pin
sojijolan17-Aug-04 6:46
susssojijolan17-Aug-04 6:46 
GeneralProgram Interface (API) Pin
sergeyv200217-Aug-04 6:04
sergeyv200217-Aug-04 6:04 
GeneralRe: Program Interface (API) Pin
palbano17-Aug-04 6:30
palbano17-Aug-04 6:30 
GeneralRe: Program Interface (API) Pin
sergeyv200217-Aug-04 7:51
sergeyv200217-Aug-04 7:51 
GeneralRe: Program Interface (API) Pin
peterchen17-Aug-04 12:26
peterchen17-Aug-04 12:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.