在 2024-10-07 00:00, Biswapriyo Nath 写道:
I think it would be good to have those `Set` member templates, which were added 
in Windows 8.1 SDK.

One of the 'Set' member template has a MSVC macro. I can not figure
out any proper alternative of that. I have replaced it with
std::is_convertible but got compiler error. Could you add those
please? I can try to compile that with gecko.


Do you mean this thing?

   ```
   template <typename T>
   HRESULT Set(
__in_opt const T &strRef, // const-ref required in case caller has a type convertible to const wchar_t*, but not copy-able typename ::Microsoft::WRL::Details::EnableIf< __is_convertible_to(T,const wchar_t*), ::Microsoft::WRL::Details::Dummy>::type = ::Microsoft::WRL::Details::Dummy()) throw()
   ```

This can be declared as

   ```
   #include <type_traits>  // std::enable_if, std::is_convertible

   template<typename T>
   HRESULT Set(
     const T& strRef,
     typename std::enable_if<
         std::is_convertible<T, const wchar_t*>::value,
         ::Microsoft::WRL::Details::Dummy>::type
       /* no name */ = ::Microsoft::WRL::Details::Dummy())
     throw()
   ```





--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to