Discussed in #1120
Originally posted by ddave-440 December 7, 2021
I have a simple console app (VS2019) on Windows 10 that will build with C++14 but not with C++17 or C++20.
The app is:
#include <iostream>
#include "opentelemetry/exporters/jaeger/jaeger_exporter.h"
#include "opentelemetry/sdk/trace/simple_processor.h"
#include "opentelemetry/sdk/trace/tracer_provider.h"
#include "opentelemetry/trace/provider.h"
namespace trace = opentelemetry::trace;
namespace nostd = opentelemetry::nostd;
namespace trace_sdk = opentelemetry::sdk::trace;
namespace jaeger = opentelemetry::exporter::jaeger;
int main()
{
std::cout << "Hello World!\n";
}
With C++17, I get errors such as:
opentelemetry\nostd\absl\meta\type_traits.h(620,1): error C4996: 'std::result_of<Op (const bool &)>': 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. 1> with 1> [ 1> Op=opentelemetry::v1::sdk::common::AttributeConverter & 1> ] 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\type_traits(1739,1): message : see declaration of 'std::result_of<_Callable(_Args...)>'
With C++20, I get:
\api\include\opentelemetry\nostd\absl\meta\type_traits.h(620,35): error C2039: 'result_of': is not a member of 'std' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\functional(31): message : see declaration of 'std'
I am probably missing something but am wondering if this should build with C++17 or C++20 without changes?
Discussed in #1120
Originally posted by ddave-440 December 7, 2021
I have a simple console app (VS2019) on Windows 10 that will build with C++14 but not with C++17 or C++20.
The app is:
With C++17, I get errors such as:
opentelemetry\nostd\absl\meta\type_traits.h(620,1): error C4996: 'std::result_of<Op (const bool &)>': 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. 1> with 1> [ 1> Op=opentelemetry::v1::sdk::common::AttributeConverter & 1> ] 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\type_traits(1739,1): message : see declaration of 'std::result_of<_Callable(_Args...)>'With C++20, I get:
\api\include\opentelemetry\nostd\absl\meta\type_traits.h(620,35): error C2039: 'result_of': is not a member of 'std' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\functional(31): message : see declaration of 'std'I am probably missing something but am wondering if this should build with C++17 or C++20 without changes?