problem with Tuple over user-defined class

baleog maccarka at yahoo.com
Wed Jul 2 09:43:03 PDT 2008


Hello,
Tuple from the typecons works fine with the basic data types. But not with the user-defined classes.
Test code:
--
import std.typecons;
class A 
{
  int x;
}

unittest
{
  Tuple!(int) x; // works fine
  Tuple(A) y; /* Error: identifier 'A' is not defined
                        Error: A is used as a type
                       ~/dmd/src/phobos/std/typecons.d: variable std.typecons.Values!(A).Tuple.T voids have no value */
}
--
does it possible to use Tuple struct from typecons with the user-defined class?

Thank you

p.s. dmd-2.014


More information about the Digitalmars-d-learn mailing list