Fractal wrote:
Hello
Any body can explan me how to determine if a template argument is an array?
Thanks
Have a look at std.traits or tango.core.Traits. The appropriate way to
check is via the templates they define, since it's clearer. Looking at
the source will tell you how to replicate the
Reply to Frits,
BCS wrote:
Are there any cases where the following cases both compile but are
not identical?
A a;
B b;
a = b;
a.Foo();
and
A a;
B b;
a = b;
b.Foo();
struct A {
int i;
void Foo() { i = 42; }
}
alias A B;
The first case will set a.i to 42, the second will set b.i.
I w
Fractal Wrote:
> Hello
>
> Any body can explan me how to determine if a template argument is an array?
...And also if is an associative array
> Thanks
Hello
Any body can explan me how to determine if a template argument is an array?
Thanks
BCS wrote:
Are there any cases where the following cases both compile but are not
identical?
A a;
B b;
a = b;
a.Foo();
and
A a;
B b;
a = b;
b.Foo();
struct A {
int i;
void Foo() { i = 42; }
}
alias A B;
The first case will set a.i to 42, the second will set b.i.
And with op
Are there any cases where the following cases both compile but are not
identical?
A a;
B b;
a = b;
a.Foo();
and
A a;
B b;
a = b;
b.Foo();
The reason I ask is I'm wondering if making the type (and value) of an assignment
expression the right hand side rather than the left hand side wou
bearophile wrote:
I have a tuple of classes (D1 language), I'd like to instantiate one of them
directly with new, but it seems I can't:
template Tuple(T...) { alias T Tuple; }
class Foo { static void foo(){} }
class Bar {}
alias Tuple!(Foo, Bar) ClassTuple;
void main() {
alias ClassTuple[
On Thu, May 21, 2009 at 11:13 AM, bearophile wrote:
> Jarrett Billingsley:
>
>> When it tries to parse
>> the type following 'new', it interprets the brackets as meaning an
>> array type,<
>
> I agree. But not even this works:
> new (ClassTuple[0]);
>
> Bye,
> bearophile
Have you tried reading th
Jarrett Billingsley:
> When it tries to parse
> the type following 'new', it interprets the brackets as meaning an
> array type,<
I agree. But not even this works:
new (ClassTuple[0]);
Bye,
bearophile
On Thu, May 21, 2009 at 10:31 AM, bearophile wrote:
> I have a tuple of classes (D1 language), I'd like to instantiate one of them
> directly with new, but it seems I can't:
>
> template Tuple(T...) { alias T Tuple; }
>
> class Foo { static void foo(){} }
> class Bar {}
> alias Tuple!(Foo, Bar) C
Daniel Keep wrote:
white_man wrote:
Does it possible to modify DMD and publish it in that form. Of course with full information about authors. Does it legal?
It depends. If you ONLY modify the front-end (front-end files are
identified as being licensed under GPL [1]), then you can distribute
I have a tuple of classes (D1 language), I'd like to instantiate one of them
directly with new, but it seems I can't:
template Tuple(T...) { alias T Tuple; }
class Foo { static void foo(){} }
class Bar {}
alias Tuple!(Foo, Bar) ClassTuple;
void main() {
alias ClassTuple[0] Foo0;
new Foo
BCS wrote:
Hello reimi,
i have 2 question here:
1) can anyone suggest good html parser with d binding?
IIRC ANTLR can generate D
The last supported version was 2.7.something. It depends on phobos,
possibly a rather old version of it (I don't know).
white_man wrote:
> Does it possible to modify DMD and publish it in that form. Of course with
> full information about authors. Does it legal?
It depends. If you ONLY modify the front-end (front-end files are
identified as being licensed under GPL [1]), then you can distribute the
modified fro
Does it possible to modify DMD and publish it in that form. Of course with full
information about authors. Does it legal?
On Thu, 21 May 2009 05:58:04 -0400, MLT wrote:
>> Because new elements are pre-initialized in D.
>>
>> Just by increasing the length, you 'create' a new element (from the 'b'
>> point of view) so D initializes it.
>
> (We were talking about something like
> int a[] = [1,2,3,4,5] ;
> b = a ;
> a
> Because new elements are pre-initialized in D.
>
> Just by increasing the length, you 'create' a new element (from the 'b'
> point of view) so D initializes it.
(We were talking about something like
int a[] = [1,2,3,4,5] ;
b = a ;
a ~= 6 ;
b.length = b.length+1;)
Hmmm... yes, that has some l
On Thu, 21 May 2009 05:37:59 -0400, MLT wrote:
> Derek Parnell Wrote:
>
>>
>> So remember, assigning one array to another is just creating an alias to
>> the original array. You end up with two arrays pointing to the same data
>> buffer.
>
> Yes. My question relates to what happens when you go
Derek Parnell Wrote:
>
> So remember, assigning one array to another is just creating an alias to
> the original array. You end up with two arrays pointing to the same data
> buffer.
Yes. My question relates to what happens when you go beyond the bounds
originally assigned.
Why does an extensio
On Thu, 21 May 2009 04:51:16 -0400, MLT wrote:
> After a discussion on digitalmars.D I played with arrays a bit. Look at the
> following code:
> int[] a = [1,2,3,4,5,6,7,8,9] ;
> int[] b = a ;
> a ~= 10 ;
> b ~= 11 ;
> b[0] =
After a discussion on digitalmars.D I played with arrays a bit. Look at the
following code:
int[] a = [1,2,3,4,5,6,7,8,9] ;
int[] b = a ;
a ~= 10 ;
b ~= 11 ;
b[0] = 12 ;
Stdout(b).newline ;
Robert Fraser schrieb:
> reimi gibbons wrote:
>> 2) how reliable is bcd to create binding for c libraries?
>
> C? Very reliable (unless it uses weird compiler directives). C++ is a
> bit trickier.
Last time I used BCD, it had no support for bitfields and generated
struct definition that do not ma
22 matches
Mail list logo