From -9115802661820155853
X-Google-Thread: f78e5,f1baa317914feeaf
X-Google-Attributes: gidf78e5,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: "Joe Smith" <unknown_kev_cat@hotmail.com>
Newsgroups: comp.std.c++
Subject: Re: typeof keyword
Date: Sat, 28 Mar 2009 12:43:37 CST
Organization: Mixmin
Lines: 29
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <gqj6an$auq$1@news.mixmin.net>
References: <488de3d4-77ac-4c01-8130-d196dec70bc8@v15g2000yqn.googlegroups.com>
  <gqdl38$gtu$1@news.mixmin.net>
  <d78092d1-73d4-4e20-b93a-9d1fb2849bb3@r15g2000vbi.googlegroups.com>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=original
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Fri, 27 Mar 2009 14:38:02 -0400
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:360


"Olivier" wrote:
> Why wasn't the wording "typeof" kept instead of "decltype" ?

Because the typeof() extention is some compilers is ever so slightly
different than the decltype() feature.

Here is how the typeof operator works in some compilers:

int a;
int &b=a;
typeof(a) c; //This declares an int named c.
typeof(b) d; //This declares an int named d.

But with decltype:

int a;
int &b=a;
decltype(a) c; //This declares an int named c.
decltype(b) d; //This declares an int& named d.



-- 
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



