cv::Mat mask, foreground;
std::thread t(cv::threshold, mask, foreground, 254, 255, cv::THRESH_BINARY);
t.join();
< /code>
Kompilierung mit Xcode 8 mit Unterstützung für C ++ 11. Irgendwelche Ideen?In file included from /Users/mlitvin/xcode/Create/ImageProcUtils.cpp:13:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:347:5: error: attempt to use a deleted function
__invoke(_VSTD::move(_VSTD::get(__t)), _VSTD::move(_VSTD::get(__t))...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:357:5: note: in instantiation of function template specialization 'std::__1::__thread_execute' requested here
__thread_execute(*__p, _Index());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:369:42: note: in instantiation of function template specialization 'std::__1::__thread_proxy' requested here
int __ec = pthread_create(&__t_, 0, &__thread_proxy, __p.get());
^
/Users/mlitvin/xcode/Create/ImageProcUtils.cpp:71:21: note: in instantiation of function template specialization 'std::__1::thread::thread' requested here
std::thread t(cv::threshold, mask, foreground, 254, 255, cv::THRESH_BINARY);
^
In file included from :368:
In file included from :3:
In file included from /Users/mlitvin/xcode/Create/Create/Create_Prefix.h:25:
In file included from /Users/mlitvin/xcode/Create/3rdParty/OpenCV-2.3.1/modules/imgproc/include/opencv2/imgproc/imgproc.hpp:50:
In file included from /Users/mlitvin/xcode/Create/3rdParty/OpenCV-2.3.1/modules/core/include/opencv2/core/core.hpp:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:625:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:1087:5: note: '~__nat' has been explicitly marked deleted here
~__nat() = delete;
^
1 error generated.
Dies ist der Code, den ich verwende: < /p> [code]cv::Mat mask, foreground; std::thread t(cv::threshold, mask, foreground, 254, 255, cv::THRESH_BINARY); t.join(); < /code> Kompilierung mit Xcode 8 mit Unterstützung für C ++ 11. Irgendwelche Ideen?In file included from /Users/mlitvin/xcode/Create/ImageProcUtils.cpp:13: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:347:5: error: attempt to use a deleted function __invoke(_VSTD::move(_VSTD::get(__t)), _VSTD::move(_VSTD::get(__t))...); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:357:5: note: in instantiation of function template specialization 'std::__1::__thread_execute' requested here __thread_execute(*__p, _Index()); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread:369:42: note: in instantiation of function template specialization 'std::__1::__thread_proxy' requested here int __ec = pthread_create(&__t_, 0, &__thread_proxy, __p.get()); ^ /Users/mlitvin/xcode/Create/ImageProcUtils.cpp:71:21: note: in instantiation of function template specialization 'std::__1::thread::thread' requested here std::thread t(cv::threshold, mask, foreground, 254, 255, cv::THRESH_BINARY); ^ In file included from :368: In file included from :3: In file included from /Users/mlitvin/xcode/Create/Create/Create_Prefix.h:25: In file included from /Users/mlitvin/xcode/Create/3rdParty/OpenCV-2.3.1/modules/imgproc/include/opencv2/imgproc/imgproc.hpp:50: In file included from /Users/mlitvin/xcode/Create/3rdParty/OpenCV-2.3.1/modules/core/include/opencv2/core/core.hpp:56: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:625: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:1087:5: note: '~__nat' has been explicitly marked deleted here ~__nat() = delete; ^ 1 error generated. [/code] [b] Bearbeiten 1: [/b] Sieht so aus>
Während ich normalerweise meine eigenen Klassen verwende, die vor stl erstellt wurden. Ich habe beschlossen, diese STL -Objekte und Funktionen in einer eigenständigen Bibliothek zu verwenden, die...
Ich habe mehrere Threads, die gleichzeitig an unterschiedlichen Problemen arbeiten.
Manchmal warten einige Threads auf die Ergebnisse anderer Threads, deren Status durch eine boolesche Variable...
Angenommen, ich habe ein std :: atomic und verschiedene Threads führen Operationen wie std :: string foo = map ; und map = baz . Ich speichere keine Referenzen oder Zeiger auf die Werte in der Karte....