Re: Generic Class Alias Syntax

2009-06-08 Thread eris
Robert Fraser Wrote: > eris wrote: > > bearophile Wrote: > > > >> eris: > >>> Is there any way to get around including the exclamation point?< > >> !(int) tells the template what type is T. Somewhere you have to tell it > >> what type of items you want to put inside it. > >> The alternative is l

Re: Generic Class Alias Syntax

2009-06-05 Thread Steve Teale
Robert Fraser Wrote: > > > That's a bad, cold, lonely day. :-) > > > > bye > > And then you come across Lisp, and see a glimmer of hope. An hour after > that, you decide to hang yourself. ((Why?))

Re: Generic Class Alias Syntax

2009-06-05 Thread BCS
Hello Robert, eris wrote: bearophile Wrote: eris: Is there any way to get around including the exclamation point?< !(int) tells the template what type is T. Somewhere you have to tell it what type of items you want to put inside it. The alternative is like the old Java, where your colle

Re: Generic Class Alias Syntax

2009-06-04 Thread Robert Fraser
eris wrote: bearophile Wrote: eris: Is there any way to get around including the exclamation point?< !(int) tells the template what type is T. Somewhere you have to tell it what type of items you want to put inside it. The alternative is like the old Java, where your collections contain refe

Re: Generic Class Alias Syntax

2009-06-04 Thread bearophile
eris: > Okay. I just assumed that since it was aliased .. and .. I included a type > that matched the template parameter it should be able to sort that out. > Re-reading the syntax specs should enlighten me.< If you want to instantiate a template and you have a value of the actual type, then

Re: Generic Class Alias Syntax

2009-06-04 Thread eris
bearophile Wrote: > eris: > > Is there any way to get around including the exclamation point?< > > !(int) tells the template what type is T. Somewhere you have to tell it what > type of items you want to put inside it. > The alternative is like the old Java, where your collections contain > ref

Re: Generic Class Alias Syntax

2009-06-04 Thread eris
Daniel Keep Wrote: > > > eris wrote: > > ... > > > > Is there any way to get around including the exclamation point? > > > > Thanks, > > > > eris > > No. Succint! :-) > If you want more explanation than that: No, because if you did, the > parser wouldn't be able to tell when something is

Re: Generic Class Alias Syntax

2009-06-04 Thread bearophile
eris: > Is there any way to get around including the exclamation point?< !(int) tells the template what type is T. Somewhere you have to tell it what type of items you want to put inside it. The alternative is like the old Java, where your collections contain references to Object, used to store

Re: Generic Class Alias Syntax

2009-06-04 Thread Daniel Keep
eris wrote: > ... > > Is there any way to get around including the exclamation point? > > Thanks, > > eris No. If you want more explanation than that: No, because if you did, the parser wouldn't be able to tell when something is supposed to be a type and when it's supposed to be an expre

Generic Class Alias Syntax

2009-06-04 Thread eris
Previously we were having fun with generic programming. When last we tuned in I had... An enum: enum ORDER {DESCENDING, ASCENDING}; An Interface: public interface Ranker(T) { bool submit(T value); // submits a value of type T to be included in top 'n' values, true if added or alrea