digitalmars.D.learn - problem with Tuple over user-defined class
- baleog (20/20) Jul 02 2008 Hello,
- baleog (3/4) Jul 02 2008 need to read "Tuple!(A) y;"
- Koroskin Denis (21/44) Jul 02 2008 Confirm, 2.009 and 2.015 suffer from the same problem. Don't have other ...
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
Jul 02 2008
baleog Wrote:Tuple(A) y; /* Error: identifier 'A' is not definedneed to read "Tuple!(A) y;" sorry
Jul 02 2008
On Wed, 02 Jul 2008 20:43:03 +0400, baleog <maccarka yahoo.com> wrote: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.014Confirm, 2.009 and 2.015 suffer from the same problem. Don't have other versions nearby to test. Simplified test case: Test.d ~~~~~~ import std.typecons; class A { int x; } Tuple!(A) y; // end of Test.d Output: Error: identifier 'A' is not defined Error: A is used as a type C:\dmd\bin\..\src\phobos\std\typecons.d: variable std.typecons.Tuple!(A).Tuple._0 voids have no value C:\dmd\bin\..\src\phobos\std\typecons.d(522): template instance std.typecons.Tuple!(A) error instantiating Line numbers not mentioned, too. Anyone fills the bug report?
Jul 02 2008