Używam funkcji tbb :: parallel_for, które korzystają z lambdas. Dostaję błędy składniowe w następującym kodzie:Jak włączyć kompilator C++ 11 w edycji ekspresowej Visual Studio 2010?
void parallel_relax(Class object, std::vector<Vertex *> verList) {
tbb::parallel_for (blocked_range<int>(0, verList.size()), [=](const blocked_range<Vertex *>& r) {
for(Vertex *vit = r.begin(); vit != r.end(); ++vit) {
Vertex *v = vit;
object.function(v);
}
});
}
składni Błędy:
syntax error : '['
1>main.cpp(16): error C2143: syntax error : missing ')' before '{'
1>main.cpp(16): error C2143: syntax error : missing ';' before '{'
1>main.cpp(17): error C2065: 'r' : undeclared identifier
1>main.cpp(17): error C2228: left of '.begin' must have class/struct/union
1> type is ''unknown-type''
1>main.cpp(17): error C2065: 'r' : undeclared identifier
1>main.cpp(17): error C2228: left of '.end' must have class/struct/union
1> type is ''unknown-type''
1>main.cpp(20): error C2059: syntax error : ')'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
myślę, że to jest problem z kompilatora. W jaki sposób mogę uzyskać kompilator C++ 11 dla edycji ekspresowej Visual Studio 2010. Proszę zasugeruj.
Co to są linie 16 i 17? –
"tbb :: parallel_for" to linia 16 i "for (Vertex * vit = r.begin(); vit! = R.end(); ++ vit)" to linia 17 – Hello
, więc nie będę w stanie używać C++ 11, ponieważ jestem w Windows 7 i mogę używać tylko Visual Studio 2010? BTW ... Nie chcę używać Eclipse z MinGW G ++, ponieważ uważam to za brzydkie ... :( – ha9u63ar