Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions include/stdexec/functional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ import stdexec;
# include <functional>
# endif

# if STDEXEC_CLANG() && STDEXEC_CLANG_VERSION < 1900
# define STDEXEC_COMPOSED_NO_UNIQUE_ADDRESS
# else
# define STDEXEC_COMPOSED_NO_UNIQUE_ADDRESS STDEXEC_ATTRIBUTE(no_unique_address)
# endif

// NOLINTNEXTLINE(bugprone-std-namespace-modification, modernize-concat-nested-namespaces)
namespace STDEXEC
{
template <class _Fun0, class _Fun1>
struct STDEXEC_ATTRIBUTE(empty_bases) __composed
: _Fun0
, _Fun1
struct __composed
{
// clang-format off
template <class _Self, class... _Ts>
Expand All @@ -48,9 +52,12 @@ namespace STDEXEC
STDEXEC_ATTRIBUTE(host, device, always_inline)
constexpr STDEXEC_EXPLICIT_THIS_BEGIN(auto operator())(this _Self &&__self, _Ts &&...__ts)
STDEXEC_AUTO_RETURN(
static_cast<__copy_cvref_t<_Self, _Fun0> &&>(__self)(
static_cast<__copy_cvref_t<_Self, _Fun1> &&>(__self)(static_cast<_Ts &&>(__ts)...)))
static_cast<_Self &&>(__self).__fun0_(
static_cast<_Self &&>(__self).__fun1_(static_cast<_Ts &&>(__ts)...)))
STDEXEC_EXPLICIT_THIS_END(operator())

STDEXEC_COMPOSED_NO_UNIQUE_ADDRESS _Fun0 __fun0_;
STDEXEC_COMPOSED_NO_UNIQUE_ADDRESS _Fun1 __fun1_;
// clang-format on
};

Expand Down Expand Up @@ -491,4 +498,6 @@ namespace STDEXEC
}
} // namespace STDEXEC

# undef STDEXEC_COMPOSED_NO_UNIQUE_ADDRESS

#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW)
Loading