> Can you think of any ways to express it in the function signature
Not in an elegant way unless the introduction of a "function concept".
> I wonder how would I express it?
Let's have fun:
// blah models the Function concept
blah(int a) { ... }
// fubar models the my_function concept
my_function fubar(Stack x, Stack y) : bool {
...
}
concept my_function {
refines {
Function;
}
returns {
bool;
}
// well, hum...
parameter<T> {
T, T; // order is important!
}
}
concept Function {
// empty
}
Other parameter examples:
// blah(int a, bool b)
parameter {
int, bool;
}
// blah(int a, a_type b, an_other c)
parameter<T, U> {
int, U, T;
}
// blah()
parameter {
}
What if we need other assertions/constraints ?
parameter<T, U> {
int, U, T;
assert {
static_assert<...>;
meta_if<...>;
// etc.
}
}
What do you think ?