472,338 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

"instantiated from here" compile error when using template

I have the following code, which use template as the parent class of my
other class.

But I have "instantiated from here" compile error at this line:
class C: public B2<A>.

Can some one please tell me why?

class AI {

public:
~AI() {};
virtual void print(int i) = 0;

};
class A {
private:
A(const A& aimpl) {};

public:
int i;
void print(int i) { cout << "hello world " << endl; }
A(): i(9){};
};
template<class T>
class B2: public AI {

public:
~B2() {};
virtual void print(int i) { cout << i<< endl; };
};

class C: public B2<A> { // "instantiated from here" compile error
this line

};

int main(int argc, char **argv) {

C c;
c.print(1);
}

Feb 18 '06 #1
2 9790
yi*****@gmail.com wrote:
I have the following code, which use template as the parent class of my
other class.

But I have "instantiated from here" compile error at this line:
class C: public B2<A>.

Can some one please tell me why?


This message is a helper for one that came earlier. The earlier one told
you what the error was, and where it occurred. This one points you to
the location where the template with the error was being instantiated.

--

Pete Becker
Roundhouse Consulting, Ltd.
Feb 18 '06 #2
Pete Becker wrote:
yi*****@gmail.com wrote:
I have the following code, which use template as the parent class of my
other class.

But I have "instantiated from here" compile error at this line:
class C: public B2<A>.

Can some one please tell me why?


This message is a helper for one that came earlier. The earlier one told
you what the error was, and where it occurred. This one points you to
the location where the template with the error was being instantiated.


That's compiler-dependent. In my experience, it is a helper for the
message which follows, not the prior.

Luke

Feb 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings...
0
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's...
5
by: RodneyDunes | last post by:
My site did validate and now it doesn't. The error I get is the following: document type does not allow element "META" here ....nt-type"...
27
by: Tom Rodman | last post by:
I want to embed a bash script inside the c program. How could you do the below bash snippet in "c"?: cat > /tmp/foo <<\__EOD_ all kinds of...
1
by: JohnZing | last post by:
i tried to install asp.net forums all went ok, but after login i always get "Object moved to here." in firefox or "The page cannot be displayed" in...
2
by: ken.carlino | last post by:
Hi, I have the following compile error instantiated from here, I appreciate if someone can help me find out why? g++ -O0 -g3 -Wall -c...
2
by: samyuktha takkellapati | last post by:
create or replace trigger emp_trigger after update or delete on employee for each row begin if updating then insert into...
0
by: gkinu | last post by:
Crystal Report for Visual Studio.NET 2003. I have a formula that brings an error " .. A number is required here ... ". See the code snippet below...
22
by: MLH | last post by:
100 Dim db As Database, rst As Recordset 120 Set db = CurrentDb 140 PString = "SELECT qryBatchList.ReadyFor906, qryBatchList.BatchID FROM...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

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.