Re: How to realize isSortedRange?

2014-08-20 Thread Alexandr Druzhinin via Digitalmars-d-learn
Thank you!

How to realize isSortedRange?

2014-08-19 Thread Alexandr Druzhinin via Digitalmars-d-learn
I need to ensure that range passed to function is SortedRange to use binary search. I did something like: static if(!__traits(compiles, { ElementType!(typeof(data)) element; auto d = data.trisect(element); } )) assert(0, "DataRange shall be

Re: extern (C++, N) is it implemented?

2014-08-06 Thread Alexandr Druzhinin via Digitalmars-d-learn
06.08.2014 10:54, Dicebot пишет: On Wednesday, 6 August 2014 at 06:50:59 UTC, Alexandr Druzhinin wrote: This dlang.org/cpp_interface.html says I can do the following // c++ namespace N { void someCppFunction(); } // d extern (C++, N) void someCppFunction(); but this http://dpaste.dzfl.pl/

extern (C++, N) is it implemented?

2014-08-05 Thread Alexandr Druzhinin via Digitalmars-d-learn
This dlang.org/cpp_interface.html says I can do the following // c++ namespace N { void someCppFunction(); } // d extern (C++, N) void someCppFunction(); but this http://dpaste.dzfl.pl/e2242263e1dc says I can't Is this feature implemented?

[std.c.stdlib] (malloc(something) is null) or (malloc(something) == 0)?

2014-05-20 Thread Alexandr Druzhinin via Digitalmars-d-learn
In D code I do void* data = GC.malloc(...); if(data is null) ... In C code I do void* data = malloc(...); if(data == null) ... What to do when in D code I have void* data = std.c.stdlib.malloc(...); if(data ?) // is null vs == 0