-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Thanks for all the replies.
They brought me on the right track.
The solution I've got now is also known as the Barton and Nackman Trick.
It's a bit pervert - but totaly legal C++ code:
templatetypename leaftype
class A
{
leaftype asLeaf()
{
On Wednesday 19 January 2005 06:53, Christian Mayer wrote:
Thanks for all the replies.
They brought me on the right track.
The solution I've got now is also known as the Barton and Nackman Trick.
It's a bit pervert - but totaly legal C++ code:
templatetypename leaftype
class A
{
It sounds to me like you should just drop the virtual function
declaration in the abstract A class (or make it non-virtual). It
serves no purpose other than trying to enforce your design on the
subclasses. Since you require the foo() function to take a parameter of
the subclass type, only a B can
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
can someone help me to solve thise problem:
Imagine I've got this class hierachy:
class A
{
virtual bool foo( A bar ) = 0;
}
class B : A
{
bool foo( B bar )
{
...
}
}
int main( void )
{
B foobar;
}
this won't compile as
On Sat, 15 Jan 2005 15:12:57 +0100, Christian Mayer
[EMAIL PROTECTED] wrote:
But I only want class A to be an interface that tells everybody what to
expect from it's derivated classes. And one of these things is, that
every child must have a member that is called foo and has one
parameter of
Hello Christian,
If I understand your problem right, you could
use class pointers (but you won't achieve strong
typing at compile time), or templates.
TEMPLATE EXAMPLE:
template class T class A {
virtual void foo(T param);
};
CLASS POINTER EXAMPLE:
class A {
public:
virtual void foo(A*
Christian Mayer wrote:
But I only want class A to be an interface that tells everybody what to
expect from it's derivated classes. And one of these things is, that
every child must have a member that is called foo and has one
parameter of the type of the child itself.
How do I achieve that?
template class T class A {
virtual void foo(T param);
};
Maybe I should add how to derive the class B from the template:
class B : public AB {
...
};
bye,
Manuel
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
I see code like this:
limit_value (double * value, const SGPropertyNode * arg)
.and wonder about the placement of the pointer operator.
I would think the above would be functionally different than:
limit_value (double *value, const SGPropertyNode *arg)
I think of the multiplication operator
On Tuesday, 11 November 2003 00:47, Gene Buckle wrote:
I see code like this:
limit_value (double * value, const SGPropertyNode * arg)
.and wonder about the placement of the pointer operator.
C syntax : type *p
C++ syntax : type* p
The compiler doesn't care which you use.
They both mean
Thanks for the clue Paul. :)
g.
On Tue, 11 Nov 2003, Paul Surgeon wrote:
On Tuesday, 11 November 2003 00:47, Gene Buckle wrote:
I see code like this:
limit_value (double * value, const SGPropertyNode * arg)
.and wonder about the placement of the pointer operator.
C syntax : type
On 11/10/03 at 2:47 PM Gene Buckle wrote:
I see code like this:
limit_value (double * value, const SGPropertyNode * arg)
.and wonder about the placement of the pointer operator.
I would think the above would be functionally different than:
limit_value (double *value, const SGPropertyNode
Personally I prefer
int* ip;
That would turn me into a gibbering idiot. :)
Kernighan and Richie specifically say in The C Programming Language though
that they like to write
int *ip;
since it reinforces the point that dereferencing ip (*ip) gives an int.
Now THAT makes sense. You
Huzzah! I can run again!
Thanks for the help,
Jonathan Polley
On Thursday, September 19, 2002, at 07:09 AM, Norman Vine wrote:
Jonathan Polley
I did see this code block in SkySceneLoader.cpp (I assume that it is
global data):
// Need to add a light here until we figure out how to use
When I rebuilt the MacOS X version of FlightGear, after the 3D cloud
code was added, I started getting an EXC_BAD_ACCESS runtime error. I
did some looking around with gdb and found out that the error was
happening BEFORE the main was being called.
Program received signal EXC_BAD_ACCESS,
From: Jonathan Polley [EMAIL PROTECTED]
When I rebuilt the MacOS X version of FlightGear, after the 3D cloud
code was added, I started getting an EXC_BAD_ACCESS runtime error. I
did some looking around with gdb and found out that the error was
happening BEFORE the main was being called.
16 matches
Mail list logo