Book a Demo

Author Topic: Instantiated class (C++)  (Read 3033 times)

robiwan

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Instantiated class (C++)
« on: May 05, 2007, 05:29:08 am »
I want a class that inherits several classes, one of which is a template:

class MyClass : public ClassA, public ClassB, public Template<MyClass>

In the Detail tab I chose "Instantiated" and "Arguments" to "MyClass". Then I get:

class MyClass : public ClassA<MyClass>, public ClassB<MyClass>, public Template<MyClass>

which isn't what I want. I've worked-around it by typedef'ing the Template<MyClass>, but I'd rather have it generated properly, than having to work-around it.

TIA
/Robert



Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Instantiated class (C++)
« Reply #1 on: May 05, 2007, 04:10:14 pm »
Quote
I want a class that inherits several classes, one of which is a template:

class MyClass : public ClassA, public ClassB, public Template<MyClass>

In the Detail tab I chose "Instantiated" and "Arguments" to "MyClass". Then I get:

class MyClass : public ClassA<MyClass>, public ClassB<MyClass>, public Template<MyClass>

which isn't what I want. I've worked-around it by typedef'ing the Template<MyClass>, but I'd rather have it generated properly, than having to work-around it.

TIA
/Robert
Hi Robert,

It's not just that it "isn't what I want"; it's just plain wrong!

Report this as a bug to Sparx.  You can use the [size=13]Report a Bug[/size] link via the Support link at the top of the page.
Place a reference back to this topic in the bug report.  That way, the Sparxians can see any ongoing discussion.
If you get a response, please add it to the topic.

There are quite a few issues with the way in which EA mishandles Templates -this is just another manifestation.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

robiwan

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Instantiated class (C++)
« Reply #2 on: May 07, 2007, 08:59:11 pm »
Bug acknowledgement from Sparx support:
--------------------------------
We are aware of this issue and have recorded the following issue.

Issue ID: 06080251
Description: EA only allows specification of one set of template arguments, and uses those for all generalized classes

This will be corrected in a future build of EA.  Until then, you can handle the situation by creating a typedef as you have done or manually create a class named Template<MyClass> and create a generalization to that class.

Best Regards,

Simon McNeilly
Sparx Systems Pty Ltd
----------------------------------

Thank you Simon, sounds great.

/R