GCC 5.4.0 checks if types can convert only when overload is enabled:
// DR 811. template<class _U1, class = typename enable_if<is_convertible<_U1, _T1>::value>::type> constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { }
While later versions of GCC check if this is constructive:
288 template<typename _U1, typename 289 enable_if<_PCCP::template 290 _MoveCopyPair<true, _U1, _T2>(), 291 bool>::type=true> 292 constexpr pair(_U1&& __x, const _T2& __y) 293 : first(std::forward<_U1>(__x)), second(__y) { }
In particular, _PCCP is an alias for _PCC<true, _T1, _T2> . _PCC is a feature class containing this function:
138 template <bool __implicit, typename _U1, typename _U2> 139 static constexpr bool _MoveCopyPair() 140 { 141 using __do_converts = __and_<is_convertible<_U1&&, _T1>, 142 is_convertible<const _U2&, _T2>>; 143 using __converts = typename conditional<__implicit, 144 __do_converts, 145 __not_<__do_converts>>::type; 146 return __and_<is_constructible<_T1, _U1&&>, 147 is_constructible<_T2, const _U2&&>, 148 __converts 149 >::value; 150 }
source share