Skip to content

Commit 5eddf76

Browse files
committed
add always_inline attribute to __forward_like
1 parent 3302dda commit 5eddf76

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/stdexec/__detail/__utility.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,16 @@ namespace stdexec {
102102

103103
namespace __detail {
104104
template <class _Cpcvref>
105-
inline constexpr auto __forward_like = []<class _Uy>(_Uy&& __uy) noexcept -> auto&& {
106-
return static_cast<typename _Cpcvref::template __f<std::remove_reference_t<_Uy>>>(__uy);
105+
struct __forward_like_fn {
106+
template <class _Uy>
107+
STDEXEC_ATTRIBUTE((always_inline)) constexpr auto operator()(_Uy&& __uy) const noexcept -> auto&& {
108+
return static_cast<typename _Cpcvref::template __f<std::remove_reference_t<_Uy>>>(__uy);
109+
}
107110
};
108111
} // namespace __detail
109112

110113
template <class _Ty>
111-
inline constexpr auto const & __forward_like = __detail::__forward_like<__copy_cvref_fn<_Ty&&>>;
114+
inline constexpr __detail::__forward_like_fn<__copy_cvref_fn<_Ty&&>> __forward_like{};
112115

113116
STDEXEC_PRAGMA_PUSH()
114117
STDEXEC_PRAGMA_IGNORE_GNU("-Wold-style-cast")

0 commit comments

Comments
 (0)