Re: detecting POD types

2012-12-28 Thread David Nadlinger
On Sunday, 20 May 2012 at 13:50:17 UTC, japplegame wrote: I write function template that should works only with POD types (i.e. base types, structures, enums etc.). Is there something like C++11 std::is_pod (http://en.cppreference.com/w/cpp/types/is_pod) template? Sorry for resurrecting this

Re: GtkD - missing DLLs in Gtk win32 runtime

2012-12-28 Thread evilrat
On Saturday, 29 December 2012 at 00:46:15 UTC, FG wrote: I'm trying out the latest GtkD binding. The lib has built without problems, some example programs also compile, but I can't run them. The Gtk-Runtime-3.6 archive provided at https://github.com/gtkd-developers/GtkD/downloads is missing se

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Jonathan M Davis
On Friday, December 28, 2012 23:29:38 Namespace wrote: > Spontaneous question: why was the behavior altered from lvalue to > rvalue if there is still no replacement with "auto ref" and so a > lot of code becomes invalid? > I know of course that the change was necessary, but as long as > there is no

Re: checking whether the number is NaN

2012-12-28 Thread Zhenya
On Friday, 28 December 2012 at 20:19:49 UTC, Simen Kjaeraas wrote: On 2012-42-28 16:12, Zhenya wrote: Hi! Tell me please,are there any way to check whether number is NaN? us std.math.isNaN. But if you really don't want to: float x = ...; if (x != x) { writeln( "x is NaN" ); } I'm uns

GtkD - missing DLLs in Gtk win32 runtime

2012-12-28 Thread FG
I'm trying out the latest GtkD binding. The lib has built without problems, some example programs also compile, but I can't run them. The Gtk-Runtime-3.6 archive provided at https://github.com/gtkd-developers/GtkD/downloads is missing several win32 DLL libraries: LIBRARY.GLGDK: "li

Re: Variadic templates with aliases

2012-12-28 Thread comco
On Thursday, 27 December 2012 at 21:21:24 UTC, Philippe Sigaud wrote: On Thu, Dec 27, 2012 at 9:01 PM, comco wrote: I wrote a simple template mixin to hold common operator overloads: mixin template VectorSpaceOpsMixin(Vector, Scalar, alias a, alias b) { Vector opUnary(string op)() if

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Namespace
Spontaneous question: why was the behavior altered from lvalue to rvalue if there is still no replacement with "auto ref" and so a lot of code becomes invalid? I know of course that the change was necessary, but as long as there is no fix I don't understand such ruthless change. It meant no off

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Jonathan M Davis
On Friday, December 28, 2012 22:21:09 Namespace wrote: > > 2.061 is beta. I think that the chances of it having something > > like this in it > > are very close to zero. > > > > - Jonathan M Davis > > You know how to give a suffering hope. :D LOL. Yeah, well. It's not like I'm going to lie about

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Namespace
2.061 is beta. I think that the chances of it having something like this in it are very close to zero. - Jonathan M Davis You know how to give a suffering hope. :D

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Jonathan M Davis
On Friday, December 28, 2012 13:19:01 Namespace wrote: > In consideration that Andrei said that the implementation of > "auto ref" for none-template functions are relatively easy and > that until now only the first beta of 2.061 came out: How likely > is it that "auto ref" will implemented in this

Re: ELF interpreter /libexec/ld-elf.so.1 not found

2012-12-28 Thread Adam D. Ruppe
When I used dmd on bsd, I just recompiled it from source. cd dmd2/src/dmd make -f posix.mak cp dmd ../../freebsd/bin32 and then you can use it from in there.

Re: checking whether the number is NaN

2012-12-28 Thread Simen Kjaeraas
On 2012-42-28 16:12, Zhenya wrote: Hi! Tell me please,are there any way to check whether number is NaN? us std.math.isNaN. But if you really don't want to: float x = ...; if (x != x) { writeln( "x is NaN" ); } I'm unsure how aggressive the optimizer is allowed to be in cases like this.

ELF interpreter /libexec/ld-elf.so.1 not found

2012-12-28 Thread Tyro[17]
I am attempting to install DMD on BSD and a running into some issues. The first issue is that there is no dmd.conf file bundled in freebsd/bin32. I mirrored the content of /osx/bin/dmd.conf but am not sure if there is anything unique to FREEBSD or some other BSD flavor that needs to be in this

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Namespace
I wrote a workaround for me: I implement it in Romulus. So for these functions: [code] void foo(auto ref const Foo f) { // do something with f } const(int[42]) bar(auto ref const Foo a, auto ref const Foo b) pure nothrow { // do something with a and b } const(int[42]) quatz(a

Re: checking whether the number is NaN

2012-12-28 Thread Red
Tell me please,are there any way to check whether number is NaN? http://dlang.org/phobos/std_math.html#isNaN pure nothrow @trusted bool isNaN(real x); Returns !=0 if e is a NaN. --- Seems like a slight documentation disagreement. Shows bool prototype but description sa

Re: checking whether the number is NaN

2012-12-28 Thread Zhenya
On Friday, 28 December 2012 at 15:59:35 UTC, bearophile wrote: Zhenya: Tell me please,are there any way to check whether number is NaN? http://dlang.org/phobos/std_math.html#isNaN Bye, bearophile Thank you!

checking whether the number is NaN

2012-12-28 Thread Zhenya
Hi! Tell me please,are there any way to check whether number is NaN?

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Minas Mina
On Friday, 28 December 2012 at 12:47:03 UTC, Namespace wrote: On Friday, 28 December 2012 at 12:28:01 UTC, bearophile wrote: Namespace: How likely is it that "auto ref" will implemented in this release? Walter wants to release 2.061 "soon". So maybe that's for the successive (unstable?) ver

Re: Using multiple processors

2012-12-28 Thread Russel Winder
On Thu, 2012-12-27 at 13:39 -0500, n00b wrote: > Le 24/12/2012 05:18, thedeemon a écrit : > > On Sunday, 23 December 2012 at 08:00:56 UTC, n00b wrote: > >> Hello. > >> My program has a great deal of computation to do, so I thought I'd > >> create several threads in order to use multiple processors.

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Namespace
On Friday, 28 December 2012 at 12:28:01 UTC, bearophile wrote: Namespace: How likely is it that "auto ref" will implemented in this release? Walter wants to release 2.061 "soon". So maybe that's for the successive (unstable?) version of the compiler. Bye, bearophile As long as it is impl

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread bearophile
Namespace: How likely is it that "auto ref" will implemented in this release? Walter wants to release 2.061 "soon". So maybe that's for the successive (unstable?) version of the compiler. Bye, bearophile

Re: structs are now lvalues - what is with "auto ref"?

2012-12-28 Thread Namespace
In consideration that Andrei said that the implementation of "auto ref" for none-template functions are relatively easy and that until now only the first beta of 2.061 came out: How likely is it that "auto ref" will implemented in this release? Maybe an official statement would be good. Purel

Re: Running out of memory

2012-12-28 Thread evilrat
On Friday, 28 December 2012 at 10:40:32 UTC, FG wrote: I don't require manual malloc. I wanted to make a hint to the GC, that this block can be freed, because I know there are no other pointers into it (that would be used later), while the imprecise GC finds false pointers and prevents the bloc

Re: Running out of memory

2012-12-28 Thread FG
On 2012-12-28 05:41, Jonathan M Davis wrote: The idea is that if you want to be manually freeing memory, you shouldn't be using GC memory in the first place. It's unsafe to be freeing it. Let the GC do that. If you want to manually manage memory, then manually manage it with malloc and free. If y

Re: double free or corruption error when using parallel foreach

2012-12-28 Thread FG
On 2012-12-28 01:08, Minas Mina wrote: Note that there is more code after bool hit = ... but I didn't include it because the problem is in the trace function (I commented it out and everything else worked -- apart from the things are dependent on it of course) Why don't you show the trace funct