Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Typedeffing "auto"

Reply
Thread Tools

Typedeffing "auto"

 
 
Johannes Schaub (litb)
Guest
Posts: n/a
 
      10-13-2010
I just figured that it's forbidden to "typedef auto foo_type;".

Can you think of any use-case for it? I imagine a C++0x program could
typedef "auto" to a different name in C++0x mode, and use a type-erasure
class in C++03 mode for storing some expression of an unknown type localy.

 
Reply With Quote
 
 
 
 
Juha Nieminen
Guest
Posts: n/a
 
      10-13-2010
"Johannes Schaub (litb)" <(E-Mail Removed)> wrote:
> I just figured that it's forbidden to "typedef auto foo_type;".


Would there be any practical difference to:

#define foo_type auto

?
 
Reply With Quote
 
 
 
 
Joe Gottman
Guest
Posts: n/a
 
      10-14-2010
On 10/13/2010 1:32 PM, Juha Nieminen wrote:
> "Johannes Schaub (litb)"<(E-Mail Removed)> wrote:
>> I just figured that it's forbidden to "typedef auto foo_type;".

>
> Would there be any practical difference to:
>
> #define foo_type auto
>
> ?


Respect for scope and access control.

Joe Gottman
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments