-2

I wrote a program in MSVS 2015, but I need to run it in MSVS 2013.

I get the error

"Error 1 error C2661: 'std::vector>::vector' : no overloaded function takes 21 arguments \vmwfil04\students$\1302273\visual studio 2013\projects\dartsc++2013\dartsc++2013\gui.h 22 1"

This problem is affecting all of my vectors I've created before runtime.

What could be causing this?

offending code:

vector<int> Double{ 0, 40, 2, 36, 8, 26, 12, 20, 30, 4, 34, 6, 38, 14, 32, 16, 22, 28, 18, 24, 10 };
vector<int> Normal{ 0, 20, 1, 18, 4, 13, 6, 10, 15, 2, 17, 3, 19, 7, 16, 8, 11, 14, 9, 12, 5 };
vector<int> Treble{ 0, 60, 3, 54, 12, 39, 18, 30, 45, 6, 39, 9, 57, 21, 48, 24, 33, 42, 27, 36, 15 };
vector<int> Bull { 0, 25, 50};
NathanOliver
  • 171,901
  • 28
  • 288
  • 402

2 Answers2

0

Support for these list-initialisers was new in VS 2015. It's not present in VS 2013. So you can't do it.

You'll have to take the old-fashioned, C++03 approach instead.

Community
  • 1
  • 1
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
0

I believe this is a bug in Visual Studio 2013 as it does support list initializers (2013 specific documentation of the functionality). Try enclosing the brackets in a parenthesis per this answer.

e.g. vector<int> Double({ 0, 40, 2, 36, 8, 26, 12, 20, 30, 4, 34, 6, 38, 14, 32, 16, 22, 28, 18, 24, 10 });

Community
  • 1
  • 1
dquam
  • 101
  • 4