35 lines
922 B
C++
35 lines
922 B
C++
#ifndef ALSK_ALSK_EDSL_LINK_H
|
|
#define ALSK_ALSK_EDSL_LINK_H
|
|
|
|
#include <utility>
|
|
|
|
#include "op/op.h"
|
|
|
|
namespace alsk {
|
|
namespace edsl {
|
|
|
|
template<typename Signature, typename Expression>
|
|
constexpr decltype(auto) link(Expression&& expression) {
|
|
return std::forward<Expression>(expression).template link<Signature>();
|
|
}
|
|
|
|
template<typename Signature, typename... Expressions, std::enable_if_t<(sizeof...(Expressions) > 1)>* = nullptr>
|
|
constexpr decltype(auto) link(Expressions&&... expressions) {
|
|
return link<Signature>(serial(std::forward<Expressions>(expressions)...));
|
|
}
|
|
|
|
template<typename Signature, typename Type, std::enable_if_t<not isOperand<Type>>* = nullptr>
|
|
constexpr decltype(auto) link() {
|
|
return link<Signature>(makeOperand<Type>());
|
|
}
|
|
|
|
template<typename Signature, typename Type, std::enable_if_t<isOperand<Type>>* = nullptr>
|
|
constexpr decltype(auto) link() {
|
|
return link<Signature, Type>();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
#endif
|