import std.container;
struct A {};
void main()
{
Array!(A)* arr = new Array!(A);
}
yields
bug.d(7): Error: template std.container.Array!(A).Array.__ctor
does not match any function template declaration
/usr/include/d/std/container.d(1625): Error: template
std.container.Array!(A).Array._
On Thursday, 21 June 2012 at 21:32:57 UTC, Namespace wrote:
Works in dmd 2.059 too.
Oh, good.
[code]
T template_cast(T : Object, U : Object)(U value) {
// try to convert
T val = cast(T) value;
// if convert was successful, return
if (val !is null) {
On Monday, June 18, 2012 15:22:15 maarten van damme wrote:
> and something I forgot to ask, is it a conscious decision to not print
> out fired asserts in treads? Normally when an assert fails my whole
> program crashes and I can see what went wrong. With treads however, it
> quietly dies.
It coul
On Thursday, June 21, 2012 21:00:32 maarten van damme wrote:
> I want to have two threads. One parses some content ever half hour and
> the other continuously parses commands passed from the first thread.
> When the second thread finished something it should send the results
> back to the first thr
On 06/21/2012 02:30 PM, maarten van damme wrote:
> Oh thank god, this helps soo much.
Yay! :)
Thinking more about it, assumeUnique is a more general solution which
may not be needed in every case. As long as the worker is happy with an
immutable(Result) slice, the following delegate works as w
Works in dmd 2.059 too.
[code]
T template_cast(T : Object, U : Object)(U value) {
// try to convert
T val = cast(T) value;
// if convert was successful, return
if (val !is null) {
return val;
}
// if cast fails it
Oh thank god, this helps soo much. Now I can finally do away with all
those ugly shared casts and variables in my other toy code involving
threads.
It works like a charm, great.
On 06/21/2012 12:00 PM, maarten van damme wrote:
> I want to have two threads. One parses some content ever half hour and
> the other continuously parses commands passed from the first thread.
> When the second thread finished something it should send the results
> back to the first thread who'll
On Thursday, 21 June 2012 at 17:14:34 UTC, Regan Heath wrote:
On Thu, 21 Jun 2012 14:56:37 +0100, Paul
wrote:
I wrote a program that parses a text file and writes results
as it is processing the file (i.e. many writeln()'s). On my
local harddrive it works fine. When I later used it on a fi
I want to have two threads. One parses some content ever half hour and
the other continuously parses commands passed from the first thread.
When the second thread finished something it should send the results
back to the first thread who'll present it to the user.
The messages the second thread nee
On Thursday, June 21, 2012 18:14:26 Regan Heath wrote:
> On Thu, 21 Jun 2012 14:56:37 +0100, Paul wrote:
> > I wrote a program that parses a text file and writes results as it is
> > processing the file (i.e. many writeln()'s). On my local harddrive it
> > works fine. When I later used it on a fil
On Thu, 21 Jun 2012 14:56:37 +0100, Paul wrote:
I wrote a program that parses a text file and writes results as it is
processing the file (i.e. many writeln()'s). On my local harddrive it
works fine. When I later used it on a file located on a file server, it
went from 500ms to 1 minute
A notice for some unused imports would be great too...
You could create a brute-force tool.
Rip off an import statement at a time and see if it still compiles.
One could probably modify DustMite to do that.
A notice for some unused imports would be great too...
IK:
Even if I use the -w and -wi flags I don't get warnings for
unused variables.
How to enable extra warnings?
Please vote :-)
http://d.puremagic.com/issues/show_bug.cgi?id=3960
http://d.puremagic.com/issues/show_bug.cgi?id=4694
http://d.puremagic.com/issues/show_bug.cgi?id=6449
Asking agai
On Thu, 21 Jun 2012 16:25:45 +0200, IK
wrote:
Even if I use the -w and -wi flags I don't get warnings for unused
variables.
How to enable extra warnings?
You don't get more warnings than -w unfortunately.
Even if I use the -w and -wi flags I don't get warnings for
unused variables.
How to enable extra warnings?
On Thursday, 21 June 2012 at 10:33:41 UTC, Namespace wrote:
To solve the problem of converting a Object to a specific
template class i wrote this little function.
But the mixin disturbs me. How i can get the type (in this
example Vector2D) without to mix a mixin and T.stringof?
[code]
T object
I wrote a program that parses a text file and writes results as
it is processing the file (i.e. many writeln()'s). On my local
harddrive it works fine. When I later used it on a file located
on a file server, it went from 500ms to 1 minute processing time.
It there a more efficient way to wr
To solve the problem of converting a Object to a specific
template class i wrote this little function.
But the mixin disturbs me. How i can get the type (in this
example Vector2D) without to mix a mixin and T.stringof?
[code]
T object_cast(T : Object)(Object value) {
T val = cast(T) val
I see, a bit confusing but I think I understand.
Thank you. :)
On 20/06/12 23:00, bearophile wrote:
std.variant.Algebraic?
Interesting thought. I fear it's a no-go as you'd have to specify up-front all
the possible agent choices, but I'll have a play ...
Thanks very much! :-)
On Thursday, June 21, 2012 09:48:52 Namespace wrote:
> > It's actually @trusted as per the docs. I do not know why DMD
> > infers that to be @safe.
> >
> > In any case, the solution here is this:
> > override hash_t toHash() @trusted const pure nothrow {
> >
> > return cast(ha
It's actually @trusted as per the docs. I do not know why DMD
infers that to be @safe.
In any case, the solution here is this:
override hash_t toHash() @trusted const pure nothrow {
return cast(hash_t)(this.x + this.y);
}
Yes, it's already trusted.
If I write "@trusted co
24 matches
Mail list logo