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/
http://smallcultfollowing.com/babysteps/blog/2013/04/03/associated-items-
Short version: yes, higher-kinded types and template template parameters
are the same thing. (`template class` is just one particular
higher kind; there's also `template class> class` and so
on, and varying the number of parameters, etc., which you probably know.)
Longer version hopefully upcoming
Stack overflow is your friend, you can even vote for the best anwser !
Le 7 déc. 2013 17:43, "David Piepgrass" 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:
>
> struct ListTrai
(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
{
template typedef list collection;
};
And I'd rephrase my third question:
3. If Rust had C++-style typedefs, would it make s
Of course this leads (assuming we had a `Collection` trait) to the horrendously
ugly `Numbers::(...)` 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 will probably be
post 1
I’m not sure I understand everything in your post, but this is how I’d write
you first C++ example:
struct Numbers {
priv iv: IV,// priv so the struct can only be constructed in this
module
priv fv: FV,
}
impl, F: Float, FV: Collection> Numbers {
pub fn n
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 parameters