diff --git a/README.md b/README.md index f0e271a..4f7547c 100644 --- a/README.md +++ b/README.md @@ -820,6 +820,7 @@ Description * Notes * `to_address` * If `std::pointer_traits::to_address` is available, it is used before `preview::pointer_traits::to_address`. + * ⚠️ `std::pointer_traits::to_address` is not sfinae-friendly until MSVC 2022, so not used. #### `` N/A diff --git a/include/preview/__memory/to_address.h b/include/preview/__memory/to_address.h index f1a31c1..23f09e6 100644 --- a/include/preview/__memory/to_address.h +++ b/include/preview/__memory/to_address.h @@ -24,8 +24,12 @@ struct has_to_address::to_address(std::decl template using to_address_tag = conditional_tag< +#if defined(_MSC_VER) && _MSC_VER < 1930 // std::pointer_traits is not sfinae-friendly before VS 2022 + has_to_address +#else has_to_address, has_to_address +#endif >; template