0

How to use aggregate initialization as the following line gives me error (expected ;)

 std::array<int, 5> i_array1{ {3, 4, 5, 1, 2} }; 

However I am able to compile following line of code

std::array<int, 5> a2 = {3, 2, 1,10,12};

I am trying to getting used to new array container. I am using Visual Studio 2012 Ultimate. Looking for any help. Regards

Niall
  • 30,036
  • 10
  • 99
  • 142
Ali Kazmi
  • 1,460
  • 9
  • 22

1 Answers1

1

According to this page on MSDN that Visual Studio 2012 does not support initialiser lists but 2013 does.

graham.reeds
  • 16,230
  • 17
  • 74
  • 137