You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#3182 added [[msvc::intrinsic]] attribute to the following reference-casting function templates:
forward
forward_like
move
move_if_noexcept
, which made MSVC treat a call to such a function equivalent to a simple static_cast.
Per local verifications and response from @cdacamar on Discord, it works for free functions which is equivalent to a cast. Here is an incomplete list of such functions, including internal helpers, in MSVC STL:
Reference casting functions (I've verified locally some of them and believe [[msvc::intrinsic]] works)
as_const (in <utility>)
_Possibly_const_range (in <xutility>)
_As_lvalue (in <ranges>)
Pointer casting functions (seemly works, but not very sure)
_As_const_pointer (in <xutility>)
Integer/enumeration casting functions (seemly works, but not very sure)
to_integer (in <cstddef>)
to_underlying (in <utility>)
It would be great to find all of these functions and mark them with _MSVC_INTRINSIC.
Note that the [[msvc::intrinsic]] attribute currently doesn't work for member functions (both non-static and static ones), so even though identity::operator() looks like a good candidate, it's better not to mark it with _MSVC_INTRINSIC at this moment.
@JMazurkiewicz suggested that this might be a nice candidate for "good first issue".
The text was updated successfully, but these errors were encountered:
#3182 added
[[msvc::intrinsic]]
attribute to the following reference-casting function templates:forward
forward_like
move
move_if_noexcept
, which made MSVC treat a call to such a function equivalent to a simple
static_cast
.Per local verifications and response from @cdacamar on Discord, it works for free functions which is equivalent to a cast. Here is an incomplete list of such functions, including internal helpers, in MSVC STL:
[[msvc::intrinsic]]
works)as_const
(in<utility>
)_Possibly_const_range
(in<xutility>
)_As_lvalue
(in<ranges>
)_As_const_pointer
(in<xutility>
)to_integer
(in<cstddef>
)to_underlying
(in<utility>
)It would be great to find all of these functions and mark them with
_MSVC_INTRINSIC
.Note that the
[[msvc::intrinsic]]
attribute currently doesn't work for member functions (both non-static and static ones), so even thoughidentity::operator()
looks like a good candidate, it's better not to mark it with_MSVC_INTRINSIC
at this moment.@JMazurkiewicz suggested that this might be a nice candidate for "good first issue".
The text was updated successfully, but these errors were encountered: