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


Patrick Horgan <phorgan1@yahoo.com> writes:

> In a templated class we define our difference type like this:
>
>        typedef typeof(T() - T()) differenceType;
>
> How simple, how elegant, but typeof is not part of the C++ standard,
> and isn't available when we use -std=c++0x.  Other than using
> specializations for each type that we might use with this class, is
> there some other equivalently simple way to do this?

g++ should support __typeof__ even with -std=c++0x.

Ian


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