ich Visual Studio 2012 versucht, dies sowohl mit dem Standard-Compiler und der November CTP-Compiler und die folgende unten zeigt mein Problem bin mit:emplace_back und VC++ Frustration
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); // error C2660: 'std::vector<_Ty>::emplace_back' : function does not take 6 arguments
return 0;
}
Warum auf der Erde scheint es emplace_back ist auf maximal 5 Argumente begrenzt ?? Sie sagen sogar in http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx, dass es eine willkürliche Anzahl von Argumenten dauern würde.
Gibt es einen Weg um dies, mit VS2012?
VS2012 unterstützt keine variadischen Vorlagen. VS2012 CTP unterstützt variadische Vorlagen. Theoretisch. – Puppy
@DeadMG danke für die Einstellung mich gerade. Aktualisiert. – TemplateRex