Templates with two params

A

ArbolOne

template <class T, const int> class Data{
private:
T data;
int id;
public:
Data();
protected:
};
template <class T, const int>
Data<T, const int>::Data(){
//ctor
}

What am I doing wrong?
 
A

ArbolOne

template <class T, const int> class Data{

private:

T data;

int id;

public:

Data();

protected:

};

template <class T, const int>

Data<T, const int>::Data(){

//ctor

}



What am I doing wrong?

GCC reports this error message:

.../data.cpp:6: error: type/value mismatch at argument 2 in template parameter list for 'template<class T, int <anonymous> > class jme::Data'
.../data.cpp:6: error: expected a constant of type 'int', got 'const int'
 
A

ArbolOne

Wow! You nailed it man, impressive, very impressive. Give yourself a pad on the shoulder, no, a few pads on the shoulder.
 
A

ArbolOne

Hope these are not iPads ...

Well, I am writing this program in the hope to learn more about c++, specially templates. Is there anything I should know about templates and iPads?
 
R

red floyd

Well, I am writing this program in the hope to learn more about c++, specially templates. Is there anything I should know about templates and iPads?
He was making a joke regarding "*pad* on the shoulder". Don't sweat
it. BTW, I think the iPad uses Objective-C, not C++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top