#ifndef ALSK_ALSK_EDSL_OP_IMPL_OPERAND_H #define ALSK_ALSK_EDSL_OP_IMPL_OPERAND_H #include #include #include "../../../skeleton/muscle/muscle.h" namespace alsk { namespace edsl { struct OperandTag; struct LeafTag; struct OperandBase { using IsOperand = OperandTag; constexpr OperandBase() noexcept = default; template().setup(std::declval()))* = nullptr> constexpr void setupFor(Operand& operand, S& skeleton) const noexcept { operand.setup(skeleton); } template constexpr void setupFor(Args&&...) const noexcept {} }; template struct Operand: OperandBase { using IsLeaf = LeafTag; using Function = Function_; using Signature = Signature_; using Struct = Function_; using Links = Signature_; constexpr Operand() noexcept = default; template constexpr auto link() const noexcept { return Operand{}; } }; template constexpr auto makeOperand() noexcept { return Operand{}; } template constexpr auto makeOperand() noexcept { return Operand{}; } template constexpr auto makeOperand() noexcept { using Function = Fn; return Operand{}; } } } // TODO C++17 #define alskMakeOperand(f) makeOperand() #endif