Daniel Keep:
> template Range(int n)
If some of you needs a version that takes 1 or 2 or 3 arguments, for the start,
stop and stride, take a look at my dlibs:
http://www.fantascienza.net/leonardo/so/dlibs/templates.html
Bye,
bearophile
Ary Borenszweig wrote:
> Lionello Lunesu wrote:
>>
>> "Brad Roberts" wrote in message
>> news:alpine.deb.2.00.0903121755240.4...@bellevue.puremagic.com...
>>> That said, I don't think this really helps the desired usecase much.
>>> It's
>>> useful, don't get me wrong, but still requires code to
Lionello Lunesu wrote:
"Brad Roberts" wrote in message
news:alpine.deb.2.00.0903121755240.4...@bellevue.puremagic.com...
That said, I don't think this really helps the desired usecase much.
It's
useful, don't get me wrong, but still requires code to build up the
bi-directional translations.
"Brad Roberts" wrote in message
news:alpine.deb.2.00.0903121755240.4...@bellevue.puremagic.com...
That said, I don't think this really helps the desired usecase much. It's
useful, don't get me wrong, but still requires code to build up the
bi-directional translations. Or am I missing somethi
On Thu, 12 Mar 2009, BCS wrote:
> Reply to Lionello,
>
> > cr*p, I've pasted too little. Try this one instead..
> >
> > I'll use a proper diff tool next time..
> >
>
> you client is messing with you, paste-bin the sucker or add it to a bugzilla
> item
Just to be sure the two don't get combine
//src\dmd\mtype.c, line 5025 (in TypeEnum::dotExp, after the #endif):
/* If e.tupleof
*/
if (ident == Id::tupleof)
{
/* Create a TupleExp out of the fields of the struct e:
* (e.field0, e.field1, e.field2, ...)
*/
e = e->semantic(sc); // do this before turning o
Reply to Lionello,
cr*p, I've pasted too little. Try this one instead..
I'll use a proper diff tool next time..
you client is messing with you, paste-bin the sucker or add it to a bugzilla
item
Nick Sabalausky wrote:
"Lionello Lunesu" wrote in message
news:gpc4j3$30a...@digitalmars.com...
Oops, sorry, I didn't notice this was the .learn newsgroup. I guess a
patch to the DMD source was not really what you expected. I just got so
anxious!
L.
Hey, solutions are solutions :) In fact
cr*p, I've pasted too little. Try this one instead..
I'll use a proper diff tool next time..
/* If e.tupleof
*/
if (ident == Id::tupleof)
{
/* Create a TupleExp out of the fields of the struct e:
* (e.field0, e.field1, e.field2, ..
Your attachment is zero-byte.
Oops... Try this one..
/* Create a TupleExp out of the fields of the struct e:
* (e.field0, e.field1, e.field2, ...)
*/
e = e->semantic(sc);// do this before turning on
noaccesscheck
"Lionello Lunesu" wrote in message
news:gpc4es$30a...@digitalmars.com...
> Nick Sabalausky wrote:
>> Is there any way to do this (preferably in D1) with reflection? (ie,
>> without
>> having to manually create a conversion func/lookup for every value of
>> every
>> enum.)
>>
>>
"Lionello Lunesu" wrote in message
news:gpc4j3$30a...@digitalmars.com...
> Oops, sorry, I didn't notice this was the .learn newsgroup. I guess a
> patch to the DMD source was not really what you expected. I just got so
> anxious!
>
> L.
Hey, solutions are solutions :) In fact I may very well
Oops, sorry, I didn't notice this was the .learn newsgroup. I guess a
patch to the DMD source was not really what you expected. I just got so
anxious!
L.
Nick Sabalausky wrote:
Is there any way to do this (preferably in D1) with reflection? (ie, without
having to manually create a conversion func/lookup for every value of every
enum.)
--
enum Shape
{
Square, Circle
}
char[] foo(Shape s)
{
// ?
}
// Either one of
Jarrett Billingsley wrote:
There's also std.typecons
which has an enum generator that will create toString and I think
fromString functions as well.
Which should be easily portable to D1.
On Tue, Mar 10, 2009 at 9:54 PM, Nick Sabalausky wrote:
> "MIURA Masahiro" wrote in message
> news:gp730i$30e...@digitalmars.com...
>> In D2:
>>
>> enum Shape: string
>> {
>> Square = "Square",
>> Circle = "Circle",
>> }
>>
>> void main()
>> {
>> assert(cast(string) Shape.Square == "Squa
"MIURA Masahiro" wrote in message
news:gp730i$30e...@digitalmars.com...
> In D2:
>
> enum Shape: string
> {
>Square = "Square",
>Circle = "Circle",
> }
>
> void main()
> {
>assert(cast(string) Shape.Square == "Square");
> }
So there's no built-in way to do this with compile-time refl
Nick Sabalausky wrote:
> Is there any way to do this (preferably in D1) with reflection? (ie, without
> having to manually create a conversion func/lookup for every value of every
> enum.)
>
> --
> enum Shape
> {
> Square, Circle
> }
> char[] foo(Shape s)
> {
> // ?
In D2:
enum Shape: string
{
Square = "Square",
Circle = "Circle",
}
void main()
{
assert(cast(string) Shape.Square == "Square");
}
19 matches
Mail list logo