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

    initializer_list : No such file or directory

    Hi !

    I have a project that compiles fine with VS 2010.
    As I compile it with VS 2012 it generates the entitled error.
    Why ?

    Thanks

  2. #2
    Join Date
    Jan 2013
    Posts
    44

    Re: initializer_list : No such file or directory

    I didn't change anything.
    As I begin typing #include <ini ... The editor doesn't suggest initializer_list

  3. #3
    Join Date
    Jan 2013
    Posts
    44

    Re: initializer_list : No such file or directory

    The code is :

    class A : public std::list<B> {

    public:
    A(std::initializer_list<B> l) {
    insert(end(), l.begin(), l.end());
    }
    A() : std::list<B>() {}
    };
    When I include <initializer_list> I get the error, but no error on the code.
    When I remove the include I get errors on each line of the code

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: initializer_list : No such file or directory

    Quote Originally Posted by mulfycrowh View Post
    The code is :



    When I include <initializer_list> I get the error, but no error on the code.
    When I remove the include I get errors on each line of the code
    I'm responding from my cell phone so I can't check myself. Search on msdn for std::initializer_list to find the appropriate header file to include.

  5. #5
    Join Date
    Jan 2013
    Posts
    44

    Re: initializer_list : No such file or directory

    It's <initializer_list>. So I do not understand.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: initializer_list : No such file or directory

    Now that I'm on a computer, I can look into this.

    Looks like it wasn't in the 2010 and 2012 VC release version, but is in VC 2013.
    http://msdn.microsoft.com/en-us/libr.../hh567368.aspx

    Apparently the initializer_list header was inadvertently added to the VC 2010 RC, but then removed for the release.
    http://connect.microsoft.com/VisualS...ease-candidate

    According to the last link, it never worked anyway (because even though the file was present in the RC, the compiler didn't support the feature).

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