Book a Demo

Author Topic: some problems with code generation  (Read 3676 times)

mitrii

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
some problems with code generation
« on: April 03, 2002, 07:51:47 pm »
I've recently started playing with EA (wonderful tool!), after some testing I've ran into problems...don't know it these are bugs or features, or I'm doing something wrong:

1. Import and then export the following C++ class:

template <class T>
class Shared
{
public:
      T& GetObject();
      const T& GetObject() const;
protected:
     T object;
};

the outcome:

template <class T>
class Shared
{
public:
      T GetObject();
     T GetObject() const ;
protected:
     T object;
};
which is clearly wrong.

2. strange things happen with operator != overloading:

class A
{
public:
       bool operator!=(const A& prm);
};

import and export, the outcome is:

class A
{

public:
     bool operator=(const A& prm);
};
which is quite scarry (well, compiler should give an error).

I'm on Win2k professional, using latest build 479. Hope that helps.

Alex

P.S. Is it possible to look through all user-found bugs somewhere, since I might duplicate it already?

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: some problems with code generation
« Reply #1 on: April 08, 2002, 05:26:22 am »
Hi Alex,

Thanks for the bug report.  I have made the following changes for the next release of EA

- Types returned by reference (&) are imported into EA as <type>& (eg. T&)
- const methods are reversed and generated using the 'IsQuery' check box - implying they do not change the class state.
- const return type is specified and reversed using the operation 'const' checkbox

-the problem with operator!= has been corrected

These changes will be in the next update of EA - build 482 or higher - due out in a week or so.

Thanks again for the examples, hope this will help,

Geoff Sparks