使用VS2019,我收到以下警告:
双击该警告会将我带到utility
中出现警告的代码行,但我看不到在代码库中调用触发警告的代码的位置。
如何跟踪和解决此问题?
警告信息::警告C4244“初始化”:从“double”转换为“_ty2”,可能丢失数据C:\Program Files(x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\Include\Utility152
违规代码(最后一行警告):
#if _HAS_CONDITIONAL_EXPLICIT
template <class _Other1, class _Other2,
enable_if_t<conjunction_v<is_constructible<_Ty1, _Other1>, is_constructible<_Ty2, _Other2>>, int> = 0>
constexpr explicit(!is_convertible_v<_Other1, _Ty1> || !is_convertible_v<_Other2, _Ty2>)
pair(_Other1&& _Val1, _Other2&& _Val2) noexcept(
is_nothrow_constructible_v<_Ty1, _Other1>&& is_nothrow_constructible_v<_Ty2, _Other2>) // strengthened
: first(_STD forward<_Other1>(_Val1)), second(_STD forward<_Other2>(_Val2)) {}
在生成输出中,列出了导致警告的链接,可以从该链接跟踪:
生成输出