VS 2017 program not recognizing “scoped_lock”

前端 未结 1 528
终归单人心
终归单人心 2021-01-21 16:52

I\'ve been having issues using scoped_locked in VS 2017. I believe I traced them back to the declaration, copied below. What would be the safest way t

相关标签:
1条回答
  • 2021-01-21 17:30

    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.

    0 讨论(0)
提交回复
热议问题