VS 2017 program not recognizing “scoped_lock”

只愿长相守 提交于 2019-12-02 05:44:07

From your question it is not clear if you want to disable/enable this behavior. But in general this can be controlled with the /std:c++latest compiler argument and/or overriding _HAS_CXX17 as stated in the Visual C++ Team Blog. The issue is that without ovverides the _HAS_CXX17 is defined depending on the compiler version in yvals.h (see this question) and thus this may vary depending on the version of Visual Studio (so I can't give you a straighforward answer what combo will give you the needed result since it is not clear whether you want to disable/enable it, and what is your exact Visual Studio version). As mentioned in the article, this has the downside that you may loose other features, since they did not provide a fine grained control over the STL. But you can try and see if reverting to the old STL behavior causes issues for you.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!