Skip to content

Commit

Permalink
Fix dumb MSVC bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lackhole committed Aug 26, 2024
1 parent a1f976a commit 2ef056c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#### `<memory_resource>`
N/A
Expand Down
4 changes: 4 additions & 0 deletions include/preview/__memory/to_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ struct has_to_address<T, Traits, void_t<decltype(Traits<T>::to_address(std::decl

template<typename T>
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<T, pointer_traits>
#else
has_to_address<T, std::pointer_traits>,
has_to_address<T, pointer_traits>
#endif
>;

template<typename T>
Expand Down

0 comments on commit 2ef056c

Please sign in to comment.