Ali Çehreli acehr...@yahoo.com wrote in message
news:iuqja8$7nl$2...@digitalmars.com...
{ bool result = ElementType!Range.init is null; } ))
is(typeof(ElementType!Range.init is null))
__traits(compiles, cast(void)ElementType!Range.init is null)
__traits(compiles, { return ElementType!Range.init
On Mon, 04 Jul 2011 10:31:58 -0400, Jonathan Sternberg
jonathansternb...@gmail.com wrote:
glut has the function:
void glutInit( int* pargc, char** argv );
In order to use it. Since D has an ABI compatible with C, I should be
able to
write a D file with extern (C) on the glut
Although CTFE supports ref parameters, swap doesn't appear to work. This
casues dmd to segfault in 2.053 and the current dmd master.
import std.algorithm;
import std.stdio;
string ctfeRef(ref string a, ref string b)
{
return a;
}
string ctfeSort()
{
auto x = [ a, c, b ];
On 2011-07-04 16:31, Jonathan Sternberg wrote:
glut has the function:
void glutInit( int* pargc, char** argv );
In order to use it. Since D has an ABI compatible with C, I should be able to
write a D file with extern (C) on the glut functions. How would I wrap this
function to be used
On Mon, 04 Jul 2011 12:51:48 -0400, Jacob Carlborg d...@me.com wrote:
On 2011-07-04 16:31, Jonathan Sternberg wrote:
glut has the function:
void glutInit( int* pargc, char** argv );
In order to use it. Since D has an ABI compatible with C, I should be
able to
write a D file with
How is the correct way of mix Pre and Post contracts and signature constraints
?
I try this that looks logic way and not compile :
T foo (T) (T a)
if ( is(T : real)) {
in {
assert (a 0);
}
body {
return a*2;
}
}
I get this errors :
Declaration expected, not 'if'
Johann MacDonagh johann.macdonagh@spam..gmail.com wrote in message
news:iusp80$vnr$1...@digitalmars.com...
Although CTFE supports ref parameters, swap doesn't appear to work. This
casues dmd to segfault in 2.053 and the current dmd master.
import std.algorithm;
import std.stdio;
On 04.07.2011 19:20, Zardoz wrote:
How is the correct way of mix Pre and Post contracts and signature constraints
?
I try this that looks logic way and not compile :
T foo (T) (T a)
if ( is(T : real)) {
in {
assert (a 0);
}
body {
return a*2;
}
}
I get this errors :
On 04.07.2011 19:42, simendsjo wrote:
The in should be in a block of it's own:
T foo(T)(T a)
if(...) // notice no { here
in {
} body {
}
I of course mean that if should not create a new block.
Hi, when I populate a BitArray using .init, the bits are in reverse
order, although the bytes are in the correct order.
eg:
import std.stdio,std.bitmanip;
void main() {
ubyte[] arr = [130,56,43,2];
BitArray ba;
ba.init(cast(void[])arr,32);
foreach(b; ba)
On Mon, 04 Jul 2011 19:52:10 +0200, simendsjo wrote:
On 04.07.2011 19:42, simendsjo wrote:
The in should be in a block of it's own:
T foo(T)(T a)
if(...) // notice no { here
in {
} body {
}
I of course mean that if should not create a new block.
Thanks !
I thought that the if () needs
Daniel Murphy:
Same thing happens with pointers. Reduced:
Pointers to structs in CTFE will work in DMD 2.054 :-)
Bye,
bearophile
On Mon, 04 Jul 2011 14:03:35 -0400, Christian Manning
cmanning...@gmail.com wrote:
Hi, when I populate a BitArray using .init, the bits are in reverse
order, although the bytes are in the correct order.
eg:
import std.stdio,std.bitmanip;
void main() {
ubyte[] arr = [130,56,43,2];
On 04.07.2011 20:12, Zardoz wrote:
On Mon, 04 Jul 2011 19:52:10 +0200, simendsjo wrote:
On 04.07.2011 19:42, simendsjo wrote:
The in should be in a block of it's own:
T foo(T)(T a)
if(...) // notice no { here
in {
} body {
}
I of course mean that if should not create a new block.
Thanks
On 04/07/2011 19:34, Steven Schveighoffer wrote:
On Mon, 04 Jul 2011 14:03:35 -0400, Christian Manning
cmanning...@gmail.com wrote:
Hi, when I populate a BitArray using .init, the bits are in reverse
order, although the bytes are in the correct order.
eg:
import std.stdio,std.bitmanip;
void
I've researched a bit though I still haven't come up with a solution.
Since the problem lies within (the most simple) constructor, I tried to
modify it for another outcome. If I supplied a generic parameter to the
pre-constructor the Cannot evaluate at compile time message
disappeared but two new
On Tue, 05 Jul 2011 02:44:03 +0200, Loopback wrote:
I've researched a bit though I still haven't come up with a solution.
Since the problem lies within (the most simple) constructor, I tried to
modify it for another outcome. If I supplied a generic parameter to the
pre-constructor the Cannot
bearophile bearophileh...@lycos.com wrote in message
news:iut093$1bjg$1...@digitalmars.com...
Daniel Murphy:
Same thing happens with pointers. Reduced:
Pointers to structs in CTFE will work in DMD 2.054 :-)
When they don't crash the compiler, that is.
18 matches
Mail list logo