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]

Bug in egcs ?


Hello,

egcs doesn't complain on the following code:

template <typename T>
class Object {
public:

  // ...

  Object&
  operator = (Object<T> const& e) {
    const_cast<T>(_e) = e;
    return *this;
  }

private:
  T _e;
};


According to the CD2, we should have write :

const_cast<T&>(_e) = e;

in order to get reference to _e.

with best regards,

[ Deniau Laurent -- Numerical Analysis and Signal Processing ]
[    CERN -- The European Laboratory for Particle Physics    ]
[ Laurent.Deniau@cern.ch -- http://wwwinfo.cern.ch/~ldeniau  ]


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