Hi!
It would useful for some my project,if operators could be a
template,that "return"
type.Something like
alias TypeTuple!(int,char) types;
static assert(types[1] == char) //opIndex
So can I define something like that?

It would useful for some my project,if operators could be a
template,that "return"
type.

D operators are functions, and D functions return values. And in
D types are not values (unlike Python and several other
languages), unless you use a Typeinfo or something.
Maybe if you explain better what you are trying to do someone
will be able to suggest you an alternative solution. D is not as
flexible as Lisp, but it doesn't lack
meta-programming/type-processing capabilities.
Bye,
bearophile

It would useful for some my project,if operators could be a
template,that "return"
type.

D operators are functions, and D functions return values. And
in D types are not values (unlike Python and several other
languages), unless you use a Typeinfo or something.
Maybe if you explain better what you are trying to do someone
will be able to suggest you an alternative solution. D is not
as flexible as Lisp, but it doesn't lack
meta-programming/type-processing capabilities.
Bye,
bearophile

Hi!
It would useful for some my project,if operators could be a
template,that "return"
type.Something like
alias TypeTuple!(int,char) types;
static assert(types[1] == char) //opIndex
So can I define something like that?

This works out of the box. If you want to define your own
TypeTuple-like construct, the answer is most likely going to be no.
--
Simen