Is my understanding below correct? Does any documentation need updating?
Operator precedence table lists !in as an operator:
http://wiki.dlang.org/Operator_precedence
Operator overloading documentation does not mention it:
http://dlang.org/operatoroverloading.html#binary
However, 'a !in
On Sunday, 2 August 2015 at 08:08:05 UTC, tcak wrote:
[code]
void func1(N)( const N name )
if( is(N: string) || is(N: char[]) )
{
func2( name );
}
[...]
This seems like the reasonable behavior to me. Perhaps you
should use Unqual?
I was planning to use a dynamic array of indices to represent a
deck of cards, and was wondering if there was any easy way to
shuffle the arrays contents? I checked the library docs, but
came to the conclusion that sorting arrays is a much more common
operation :)
If anyone has a suggestion
[code]
void func1(N)( const N name )
if( is(N: string) || is(N: char[]) )
{
func2( name );
}
void func2(N)( const N name )
if( is(N: string) || is(N: char[]) )
{}
void main(){
char[] blah = ['b', 'l', 'a', 'h'];
func1( blah );
//func1( blah );
...And then I realised that I hadn't looked inside std.random.
Question solved, because I am a dumbass.
On Sunday, 2 August 2015 at 09:24:12 UTC, Matt wrote:
I was planning to use a dynamic array of indices to represent a
deck of cards, and was wondering if there was any easy way to
shuffle the arrays contents? I checked the library docs, but
came to the conclusion that sorting arrays is a much
Oh, neat. This saves the day :)
2015-08-01 23:22 GMT+02:00 Ali Çehreli digitalmars-d-learn@puremagic.com:
On 08/01/2015 08:37 AM, maarten van damme via Digitalmars-d-learn wrote:
I have a class that creates a task in it's constructor. How do I store
this
created task as one of it's value
I'm writing a game engine in D. Try to minimize allocations and
that's will be OK.
I'm using delegates and all the phobos stuff. I allocate only in
few places at every frame.
So i can reach 1K fps on a complicated scene.
GC is not a problem. DMD optimizes so ugly that all the math is
very,
On 02/08/15 03:38, Dicebot via Digitalmars-d-learn wrote:
On Saturday, 1 August 2015 at 17:50:28 UTC, John Colvin wrote:
I'm not sure how good an idea it is to totally enforce a range to be
non-copyable, even if you could deal with the function call chain problem.
Even in totally save-aware
Hello
I wrote static bindings to a C library. I want to also offer a
version(Dynamic) of the bindings.
I follow and use derelict-util to get the address of function
pointers.
In the library I bind, there is also global variables. here's one
example in the static bindings:
extern __gshared
On Sunday, 2 August 2015 at 15:31:48 UTC, remi thebault wrote:
Hello
I wrote static bindings to a C library. I want to also offer a
version(Dynamic) of the bindings.
I follow and use derelict-util to get the address of function
pointers.
In the library I bind, there is also global
On Sunday, 2 August 2015 at 08:08:05 UTC, tcak wrote:
[code]
void func1(N)( const N name )
if( is(N: string) || is(N: char[]) )
{
func2( name );
}
void func2(N)( const N name )
if( is(N: string) || is(N: char[]) )
{}
void main(){
char[] blah = ['b', 'l', 'a',
On Sunday, 2 August 2015 at 16:20:29 UTC, remi thebault wrote:
On Sunday, 2 August 2015 at 15:38:34 UTC, Mike Parker wrote:
You have to declare it as a pointer, then retrieve the pointer
in the same way you do the function pointers, via the system
loader (GetProcAddress/dlsym).
and how would
is there a trait in D or Phobos which will tell you if a type can
be used as a key for an associative array? For example, where T
is some type:
static assert(isKeyType!T)
int[T] hashTable = ...
On Sunday, 2 August 2015 at 15:38:34 UTC, Mike Parker wrote:
You have to declare it as a pointer, then retrieve the pointer
in the same way you do the function pointers, via the system
loader (GetProcAddress/dlsym).
and how would you make this source compatible with the static
binding
On Sunday, 2 August 2015 at 17:55:16 UTC, Xinok wrote:
is there a trait in D or Phobos which will tell you if a type
can be used as a key for an associative array? For example,
where T is some type:
static assert(isKeyType!T)
int[T] hashTable = ...
import std.stdio;
enum
Hello,
I am trying to use rdmd to create shared object files.
The command that I am using is
rdmd --build-only -shared -fPIC -defaultlib= foo.d
This creates a file called foo - wich is not exactly what I
expectd.
However
dmd -shared -fPIC -defaultlib= foo.d
creates a file called foo.so -
On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote:
I'm in the early stages of building a little game with OpenGL
(in D) and I just want to know the facts about the GC before I
decide to either use it or work around it. Lots of people have
said lots of things about it, but some of that
On 08/02/2015 05:15 AM, maarten van damme via Digitalmars-d-learn wrote:
Oh, neat. This saves the day :)
Awesome! :) However, that solution depends on the implementation details
of std.parallelism. It is possible to do the same thing by inheriting
from an 'interface' and hiding the templated
On Saturday, 1 August 2015 at 23:02:51 UTC, bachmeier wrote:
But what type of programming are you doing? Even after decades
of programming and trying out dozens of languages, zero-based
indexing still gets me at times when the arrays I work with
represent vectors and matrices. Especially when
20 matches
Mail list logo