Hi,
I am trying to instantiate a Tuple that contains an immutable field.
Is there a way to do this with the current implementation? The
compiler gives me this error:
std/typecons.d(383): Error: can only initialize const member
_field_field_0 inside constructor
tuple_test.d(5): Error: template instance
std.typecons.Tuple!(immutable(int)).Tuple.__ctor!(int) error
instantiating
tuple_test.d(3): Error: function D main has no return statement, but
is expected to return a value of type int
here is the code:
import std.typecons;
int main()
{
Tuple!(immutable(int)) var = Tuple!(immutable(int))(5);
assert(var[0] == 5);
}
Thanks!