473,387 Members | 1,863 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,387 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 9929
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 if there's no need for variable interpolation but...
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 context menu when you right-click over a folder (or the...
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" content="text/html;charset=iso-8859-1"> Can someone...
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 nasty stuff in here including single and double...
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 IE when i hit refresh, the page loads fine. ...
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 -fmessage-length=0 -ostddev.o ../stddev.cpp...
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 empupdate(empno,ename,job,mgr,sysdate,sal,comm,deptno)...
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 which i have simplified. In the actual formula,...
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 qryBatchList WHERE...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.