Hi all,
is there any way to prevent a struct from being created directly?
Basically, I want to prevent this:
{
non_null!(T) a;
}
I want people to have to use provided functions to create a structure:
{
auto a = non_null!(T)(new T);
}
-- Daniel
When bcdgen parses a header file with errors, it still completes the
translation. Is there a way I can get bcdgen to error out? I think it's a
gccxml thing, for even while detecting errors it returns 0.
The problem is that some projects seem to have header files which are only
useful if
So it was my error, some modifications I made to bcdgen.
Sorry for the noise.
* why is it that these dumb mistakes always get apparent at once AFTER
posting ...*
Hello lutger,
So it was my error, some modifications I made to bcdgen.
Sorry for the noise.
* why is it that these dumb mistakes always get apparent at once AFTER
posting ...*
Because the newsgroup version of Murphy's Law is fairly consistant? :D
At the very least, knowing this law, we
On Mon, 26 Jan 2009 20:40:01 +0300, BCS n...@anon.com wrote:
Hello Daniel,
Hi all,
is there any way to prevent a struct from being created directly?
Basically, I want to prevent this:
{
non_null!(T) a;
}
I want people to have to use provided functions to create a structure:
{
auto a =
On Tue, 27 Jan 2009 01:08:17 +0300, Saaa em...@needmail.com wrote:
Should I report this as a bug?
And, how do I do that :)
Lol I didn't even check that.
Probably because it does compile (and gives a stack overflow at runtime)
when you put the allocation within the main.
So it still looks
Mon, 26 Jan 2009 04:50:10 + (UTC), BCS wrote:
Hello Sergey,
foreach() is a runtime construct. It may be *interpreted* at
compile-time, but it's interpreted as if it were run time
nevertheless. It dynamically changes the value of 'member' variable.
OTOH a foreach on a tuple is a
I'd like to do something like this:
static if (AType.length is a static constant ) {
const has_static_length = true;
}
else static if (AType.length exists but it's not a compile-time constant) {
const has_static_length = false;
}
else {
// there is no .length at all
}
Anyone
Hello Sergey,
but this doesn't:
template Tuple(T...)
{
alias T Tuple;
}
void foo()
{
foreach (a; Tuple!(a, b, c))
pragma(msg, a);
}
$ dmd -c test.d
test.d(8): Error: string expected for message, not 'a'
test.d(8): Error: string expected for message, not 'a'
test.d(8): Error: string expected
Denis Koroskin:
But not for this one, as it won't be fixed because of the said reason.
The limit of the linker may not be solved, but I think it's good to add an
error message to the compiler for such situation, so the compiler stops
compilation immediately with a clean error message and the
10 matches
Mail list logo