(Another big reason I like forums over mailing lists, which I forgot to
mention in that other thread, is that I can fix my mistakes!) Typo
correction:
struct ListTrait
{
templatetypename T typedef listT collection;
};
And I'd rephrase my third question:
3. If Rust had C++-style typedefs,
Stack overflow is your friend, you can even vote for the best anwser !
Le 7 déc. 2013 17:43, David Piepgrass qwertie...@gmail.com a écrit :
(Another big reason I like forums over mailing lists, which I forgot to
mention in that other thread, is that I can fix my mistakes!) Typo
correction:
Short version: yes, higher-kinded types and template template parameters
are the same thing. (`templatetypename class` is just one particular
higher kind; there's also `templatetemplatetypename class class` and so
on, and varying the number of parameters, etc., which you probably know.)
Longer
In all these cases with typedefs, you're still implicitly relying on
higher-kinded types, along with what are usually referred to as associated
types:
http://smallcultfollowing.com/babysteps/blog/2013/04/02/associated-items/
Rust newb here. I have theoretical questions.
Recently I noticed that Higher-Kinded Types (HKTs) have been mentioned on
the mailing list a lot, but I had no idea what a HKT was, or what it might
be good for. After reading about them a little, they reminded me of C++'s
template template
Of course this leads (assuming we had a `Collection` trait) to the horrendously
ugly `Numbers::i32, ~[i32], f32, ~[f32](...)` if you wanted to be explicit.
But hopefully your code would be such that Rust could infer the bounds. This
will be alleviated in the future by associated items, but that