Hello,
Please see the code below.
class A : public B<C,D,E>
{
// some data and member variables
}
class P : public Q<R,S>, public T
{
private :
Ref <A> m_typeA;
}
Now, in Ref, I am calling a method on m_typeA to maintain reference
counter. This is where I get an error. I know that the compiler has to
know the class definition before calling some method on it. But you can
see that class A has dependancy on class P. Also, forward declaration
solved the problem on UNIX. However I get " error C2027: use of
undefined type 'A' " on Windows OS.
Please help.
thanks,
- Ram 2 11323 ra*****************@gmail.com wrote: Please see the code below.
class A : public B<C,D,E>
Neither of B, C, D, or E, is defined here.
{ // some data and member variables }
; class P : public Q<R,S>, public T
Neither Q, nor R, S, or T, are defined here.
{ private : Ref <A> m_typeA;
Ref is undefined.
}
; Now, in Ref, I am calling a method on m_typeA to maintain reference counter. This is where I get an error. I know that the compiler has to know the class definition before calling some method on it. But you can see that class A has dependancy on class P.
Huh? 'A' dependent on 'P'? Where? No, *I* can't see it.
Also, forward declaration solved the problem on UNIX. However I get " error C2027: use of undefined type 'A' " on Windows OS.
Post real code, not ravings of a grey mare.
V
Change the class A declaration to
template < class C, class D, class E >
class A : public B< C, D , E >
{
// some data and member variables
};
Otherwise the compiler doesn't know what C, D, and E is. You also need
to declare B, somewhere.
To define an object of type A you need to give it the types for C, D,
and E. e.g.
A<int, double, long> a;
Greets,
Christian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: RoSsIaCrIiLoIA |
last post by:
On Mon, 07 Feb 2005 21:28:30 GMT, Keith Thompson <kst-u@mib.org>
wrote:
>"Romeo Colacitti" <wwromeo@gmail.com> writes:
>> Chris Torek wrote:
>>> In article <4205BD5C.6DC8@mindspring.com>
>>>...
|
by: kevin_g_frey |
last post by:
Hello
We have an internal tool that generates a series of .NET class wrappers
for accessing our database entities. One of our database entities is
called "System" so our correspond __gc class is...
|
by: Joe |
last post by:
I have created a web application using C#. I have done several web
based apps in C# and have not had this problem before. I think this
may be a defect in the VisualSutdio.net2003.
I am using a...
|
by: rohinichandrap |
last post by:
Hi,
I am getting the error C2027:Use of undefined type 'T' when I tried to
compile some code in visual c++7.1 that went fine in Visual c++6.0.
Below is the relevant code where the error has...
|
by: Brian Tkatch |
last post by:
Server: DB2/SUN 8.1.6
Client: DB2 Connect Personal Edition (No 11)
<URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe>
...
|
by: AngZangGui |
last post by:
I have created 2 window forms - Form1 and Form2. What I need to do now is to enable the event in Form2.h to access functions declared in Form1.cpp.
Below are parts of the codes:
//Form1.h
...
|
by: Rahul |
last post by:
Hi Everyone,
I get the error on the following code,
error C2027: use of undefined type 'B'
class AA
{
public: operator B()
{
|
by: tridirk |
last post by:
Hi; I am getting a Objceted Expected Error on my forum site. I can't find what is wrong?
Line:
Char:
Error: Object expected
Code:0
the site is My SMF Forum
|
by: rahulephp |
last post by:
i think i am missing something in the below script:
It shows error an do not upload files to destination:
Let me know how to solve this:
<?php
if (isset($_POST))
{
$uploadArray=...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
| |