libtorch from pytorch website, release mode (latest stable one)
I am able to use libtorch in a separate Visual Studio 2017 project and do the inference.
However, I need to link libtorch to another project which is using C++17 and I get deprecation errors like this:
Error C4996 'std::result_of_t': warning STL4014: std::result_of and std::result_of_t are deprecated in C++17. They are superseded by std::invoke_result and std::invoke_result_t. You can define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. WeldVision address\externals\libtorch\include\c10\util\c++17.h 34
In my own code, I disable this warning at the beginning of the header file that includes and uses the libtorch library:
#pragma once #pragma warning (push) #pragma warning(disable: 4996) // code #include <torch/script.h> //code #pragma warning (pop)
But it is not working. Do you know how I can solve this problem and how can I use this library that is build with C++14 compatible with C++17?