Re: What's the difference between (*(x)).a and (x)->a

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

> Can they be different in C++ ?
> 
> A key phrase in the question is "x is an expression which generates a
> struct pointer."
> 
> You can overload the meaning of * or -> if x is a struct.  I thought you
> couldn't overload them if x is a pointer.

I can't think of any way of overloading operations on a pointer -- struct
pointer or any other sort of pointer.  All pointers are POD.

I can think of many ways of overloading operations on an object.  Smart
pointers (e.g., std::auto_ptr) are really objects with pointer semantics.

I think you are correct.  Good eye and very careful reading... good catch!

Sincerely,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux