I am using Visual Studio 2012, trying this with both the default compiler and the Nov CTP compiler, and the following shows that my problem is:
struct doesCompile { int mA, mB, mC, mD, mE; doesCompile(int a, int b, int c, int d, int e) : mA(a), mB(b), mC(c), mD(d), mE(e) { } }; struct doesNotCompile { int mA, mB, mC, mD, mE, mF; doesNotCompile(int a, int b, int c, int d, int e, int f) : mA(a), mB(b), mC(c), mD(d), mE(e), mF(f) { } }; int _tmain(int argc, _TCHAR* argv[]) { std::vector<doesCompile> goodVec; goodVec.emplace_back(1, 2, 3, 4, 5); std::vector<doesNotCompile> badVec; badVec.emplace_back(1, 2, 3, 4, 5, 6);
Why does emplace_back seem to be limited to a maximum of 5 arguments? They even say in http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx that this will require a harsh amount of arguments.
Is there any way around this using VS2012?
c ++ vector c ++ 11 visual-c ++ stl
Kaiserjohaan
source share