+ Reply to Thread
Results 1 to 2 of 2

Thread: Why below program does not compile under Visual Studio 2010?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    48

    Why below program does not compile under Visual Studio 2010?

    I have below code:
    Code:
    void MyFun()
    {
         std::vector<int> v = { 1, 2, 3, 4, 5} ;
    }
    It fails saying : error : "C2552: 'v' : non-aggregates cannot be initialized with initializer list".

    What is this error? Why it fails?

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    49
    "initializer list" are not implemented in Visual Studio 2010. Get Visual Studio 2012.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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