This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: with -std=c++0x typeof is gone


me22 wrote:
On 28 January 2010 01:31, Patrick Horgan <phorgan1@yahoo.com> wrote:
In a templated class we define our difference type like this:

typedef typeof(T() - T()) differenceType;


That works? Wouldn't it give unsigned when T is unsigned?
Yeah, that's a problem! Love the decltype solution, but it does the same. So gcc chooses between typeof and decltype with #ifdef __GXX_EXPERIMENTAL_CXX0X__
Anyone know if that's always set for -std=c++0x?


Patrick


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