【发布时间】:2020-03-23 15:15:37
【问题描述】:
我有一个项目,我可以使用平台工具集 v120 在 VS2019 中毫无问题地编译。 我将项目重新定位为使用平台工具集 v142 和 WSDK 10。我收到以下与模板相关的编译错误。有什么想法是什么原因造成的吗?
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\utility(573,1):错误 C2440:“=”:无法从“_Other”转换为“_Ty”
with
[
_Other=int
]
and
[
_Ty=std::_Container_proxy *
] (compiling source file RTPPacketSequencer.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\utility(573,42): message : Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast (compiling source file RTPPacketSequencer.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\deque(872): message : see reference to function template instantiation '_Ty *std::exchange<std::_Container_proxy*,int>(_Ty &,_Other &&) noexcept(false)' being compiled
with
[
_Ty=std::_Container_proxy *,
_Other=int
] (compiling source file RTPPacketSequencer.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\deque(869): message : while compiling class template member function 'std::deque<T,std::allocator<T>>::~deque(void) noexcept'
with
[
T=int
] (compiling source file RTPPacketSequencer.cpp)
D:\dev\_inc\lockqueue.h(46): message : see reference to function template instantiation 'std::deque<T,std::allocator<T>>::~deque(void) noexcept' being compiled
with
[
T=int
] (compiling source file RTPPacketSequencer.cpp)
D:\dev\_inc\lockqueue.h(109): message : see reference to class template instantiation 'std::deque<T,std::allocator<T>>' being compiled
with
[
T=int
] (compiling source file RTPPacketSequencer.cpp)
D:\dev\_inc\lockqueue.h(116): message : see reference to class template instantiation 'CLockQueueTX<T>' being compiled
with
[
T=int
] (compiling source file RTPPacketSequencer.cpp)'''
【问题讨论】: