On 04/02/2011 12:14 AM, enuhtac wrote:
template isA( T )
{
static if( is( T U == A!( U, s ), string s ) )
enum bool isA = true;
else
enum bool isA = false;
};
What does , string s do here inside the is expression?
Denis
--
_
vita es estrany
Am 02.04.2011 11:24, schrieb spir:
On 04/02/2011 12:14 AM, enuhtac wrote:
template isA( T )
{
static if( is( T U == A!( U, s ), string s ) )
enum bool isA = true;
else
enum bool isA = false;
};
What does , string s do here inside the is expression?
Denis
A
Am 02.04.2011 04:00, schrieb Caligo:
On Fri, Apr 1, 2011 at 5:14 PM, enuhtac enuhtac_li...@gmx.de wrote:
Hello,
the is expression is a great feature of D - but its use is not very
intuitive, at least for me.
I'm trying to write a template that figures out if the template
parameter is of a
http://digitalmars.com/d/2.0/arrays.html says static arrays are
limited to 16mb, but I can only allocate 1mb.
My fault, or bug?
enum size = (16 * 1024 * 1024) / int.sizeof;
//int[size] a; // Error: index 4194304 overflow for static
array
enum size2 = (16 * 1000 * 1000) /
This is using dmd 2.052 on windows by the way.
On 2011-04-02 06:21, simendsjo wrote:
http://digitalmars.com/d/2.0/arrays.html says static arrays are
limited to 16mb, but I can only allocate 1mb.
My fault, or bug?
enum size = (16 * 1024 * 1024) / int.sizeof;
//int[size] a; // Error: index 4194304 overflow for static
array
I think you missed my /int.sizeof at the end.
enum size = (16*1024*1024)/int.sizeof;
int[size] a; // Error index overflow for static as expected
int[size-1] b; // stack overflow
int[250_001] c; // stack overflow
int[250_000] d; // ok
simendsjo:
The main problem is that it gives a Stack Overflow already at 250_001
I meant with the array as a global variable.
The stack on Windows can be set very large too, with -L/STACK:1000
Bye,
bearophile