CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013
    Posts
    44

    a very special loop

    Hi !

    The syntax :

    for ( const Class* c : *this )
    {
    ...
    };

    Seems not to be compatible within VS2010.
    How can I rewrite it ?

    Thanks

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: a very special loop

    That is the new for loop syntax introduced in ANSI C++ 2011 standard.
    http://en.wikipedia.org/wiki/C%2B%2B...based_for_loop

    Why not just get VS 2012? If that line is in the code, wouldn't you think that there are more C++ 11 syntax that may occur in other places in the code? If you look at the link above, there are far more changes and enhancements to the language where attempting to rewrite the code to support old syntax may introduce bugs. I don't think, for example, you want to rewrite a complex lambda expression.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; October 13th, 2013 at 04:53 PM.

  3. #3
    Join Date
    Jan 2013
    Posts
    44

    Re: a very special loop

    Thanks for the name of this new beast ... I'll take a look

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured