From 2ef056c43e37b0a00047d4fc8ac57db789622392 Mon Sep 17 00:00:00 2001 From: Yong Gyu Lee Date: Mon, 26 Aug 2024 20:57:53 +0900 Subject: [PATCH] Fix dumb MSVC bug --- README.md | 1 + include/preview/__memory/to_address.h | 4 ++++ 2 files changed, 5 insertions(+) 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