This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Named return values in C++ doesn't work ?


Hi,

This great feature I found in the doc doesn't seem to work (with gcc-2.8.1
nor the latest EGCS snapshot).

I expected something like this to compile:

class C
{
  public:
  C (const int d = 0)
  { a = d; }

  C
  operator+(const C & d) return tmp;
  {
    tmp.a += d.a;
    // C tmp (a + d.a);
    // return tmp;
  }
  int a;
};


Do I misunderstand the doc ?

Also, it's a pity (as written in the doc) that we can't specify the exact
location of the constructor.  Is someone working on implementing such a
feature ?

-- 
Sylvain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]