Typedeffing "auto"

Discussion in 'C++' started by Johannes Schaub (litb), Oct 13, 2010.

  1. 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.
     
    Johannes Schaub (litb), Oct 13, 2010
    #1
    1. Advertising

  2. "Johannes Schaub (litb)" <> wrote:
    > I just figured that it's forbidden to "typedef auto foo_type;".


    Would there be any practical difference to:

    #define foo_type auto

    ?
     
    Juha Nieminen, Oct 13, 2010
    #2
    1. Advertising

  3. Johannes Schaub (litb)

    Joe Gottman Guest

    On 10/13/2010 1:32 PM, Juha Nieminen wrote:
    > "Johannes Schaub (litb)"<> 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
     
    Joe Gottman, Oct 14, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QnJ1Y2UgUHVsbHVt?=

    DataGrid Row Auto-Size

    =?Utf-8?B?QnJ1Y2UgUHVsbHVt?=, Apr 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,043
  2. Hubble

    Auto allocation of Indexes

    Hubble, Sep 6, 2005, in forum: VHDL
    Replies:
    8
    Views:
    587
    Charles, SAG
    Sep 8, 2005
  3. =?Utf-8?B?V2FyYW4=?=

    Auto-Suggested Textbox like google auto suggest

    =?Utf-8?B?V2FyYW4=?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    8,538
    inrakeshworld
    Jul 27, 2007
  4. linkswanted
    Replies:
    1
    Views:
    948
  5. Shriramana Sharma

    typedeffing a partial specialization?

    Shriramana Sharma, Jun 27, 2013, in forum: C++
    Replies:
    1
    Views:
    173
    Victor Bazarov
    Jun 27, 2013
Loading...

Share This Page