There is an example in GC.addRoot() documentation where the programmer
is trying to mark a memory block as NO_MOVE:
http://dlang.org/phobos/core_memory.html#.GC.addRoot
auto context = new Object;
GC.addRoot(cast(void*)context);
GC.setAttr(cast(void*)context, GC.BlkAttr.NO_MOVE);
On 02.07.2014 08:17, Ali Çehreli wrote:
There is an example in GC.addRoot() documentation where the programmer
is trying to mark a memory block as NO_MOVE:
http://dlang.org/phobos/core_memory.html#.GC.addRoot
auto context = new Object;
GC.addRoot(cast(void*)context);
Is there a way to get the max size of an integer?
On Wednesday, 2 July 2014 at 08:39:06 UTC, pgtkda wrote:
Is there a way to get the max size of an integer?
int.max
The same exists for other built-ins and enums.
On Wednesday, 2 July 2014 at 08:58:46 UTC, Rene Zwanenburg wrote:
On Wednesday, 2 July 2014 at 08:39:06 UTC, pgtkda wrote:
Is there a way to get the max size of an integer?
int.max
The same exists for other built-ins and enums.
thank you very much
Is there a similar method as Math.Ceiling in D?
http://msdn.microsoft.com/en-US/en-en/library/zx4t0t48(v=vs.110).aspx
On Wednesday, 2 July 2014 at 13:36:17 UTC, pgtkda wrote:
Is there a similar method as Math.Ceiling in D?
http://msdn.microsoft.com/en-US/en-en/library/zx4t0t48(v=vs.110).aspx
http://dlang.org/phobos/std_math.html#.ceil
Is this possible?
The documentation for std.container lists in as an operator in
the container API but only associative arrays actually seem to
support it.
struct S
{
int opIn_r(int key)
{
return key*2;
}
}
void main()
{
assert((42 in S.init) == 84);
}
On Saturday, 28 June 2014 at 20:40:21 UTC, Ary Borenszweig wrote:
This doesn't work:
class Foo {
this() {
this = new Foo;
}
}
Error: Cannot modify 'this'
However you can do this:
class Foo {
this() {
auto p = this;
*p = new Foo();
}
}
It even changes the value of this!
On Wednesday, 2 July 2014 at 14:14:57 UTC, Dicebot wrote:
struct S
{
int opIn_r(int key)
{
return key*2;
}
}
void main()
{
assert((42 in S.init) == 84);
}
Thanks! I wonder, why the _r and lack of documentation?
On 07/02/2014 07:35 AM, Vlad Levenfeld wrote:
On Wednesday, 2 July 2014 at 14:14:57 UTC, Dicebot wrote:
struct S
{
int opIn_r(int key)
{
return key*2;
}
}
void main()
{
assert((42 in S.init) == 84);
}
Thanks! I wonder, why the _r
I think it is the old syntax,
On Wednesday, 2 July 2014 at 15:36:23 UTC, Kozzi11 wrote:
Thanks! I wonder, why the _r and lack of documentation?
Maybe something from old days? But in current a
href=http://dlang.org/operatoroverloading.html#Binary;
target=_blankdoc/a there is a opBinary:
Yep, I think it is D1 legacy
On Wednesday, 2 July 2014 at 14:35:55 UTC, Vlad Levenfeld wrote:
On Wednesday, 2 July 2014 at 14:14:57 UTC, Dicebot wrote:
struct S
{
int opIn_r(int key)
{
return key*2;
}
}
void main()
{
assert((42 in S.init) == 84);
}
Thanks! I wonder, why
Dicebot:
Yep, I think it is D1 legacy approach. opBinary should be more
appropriate.
I hope the usage of the old operator overloading functions will
generate deprecation messages soon.
Bye,
bearophile
Hi,
I was able to build dmd on my windows machine using VS2013 (using
the vs2010 sln file). However, I am not sure how to proceed with
building the druntime and phobos. Could someone please point me
to instructions for the same?
I tried the following
1. Downloaded make and shell (digital
On Wednesday, 2 July 2014 at 16:06:08 UTC, Kashyap wrote:
I got the following error -
C:\Users\labuser\dlang\druntimedir
..\dmd\src\vcbuild\Win32\Release\dmd_msc.exe
C:\Users\labuser\dlang\druntimeshell script.sh
shell 1.01
make -f posix.mak
DMD=../dmd/src/vcbuild/Win32/Release/dmd_msc.exe
On Sunday, 29 June 2014 at 15:06:25 UTC, Jeremy Sorensen wrote:
The only question I have is what happens when you use
SUBSYSTEM:WINDOWS:4.0 (Which I understand means XP or higher)
and the program runs on something older?
Windows XP is version 5.1.
4.0 was Windows NT 4 (which I believe was the
On Wed, Jul 02, 2014 at 02:35:54PM +, Vlad Levenfeld via
Digitalmars-d-learn wrote:
On Wednesday, 2 July 2014 at 14:14:57 UTC, Dicebot wrote:
struct S
{
int opIn_r(int key)
{
return key*2;
}
}
void main()
{
assert((42 in S.init) == 84);
}
Ah yes I never noticed that in was in the binary op table. In
my defense, searching for in usually yields too many results to
be useful. Thanks to everyone for your help!
Everything compiles fine except for function qux2:
http://dpaste.dzfl.pl/9d9187e0b450
Is this a bug or an enhancement for CTFE?
It would be really nice to have this feature because core.simd
has functions such as: void16 __simd(XMM opcode, void16 op1,
void16 op2, ubyte imm8);
Where all the
Actually, this is an enhancement because adding:
enum b = blah
Makes them fail. :(
On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote:
Actually, this is an enhancement because adding:
enum b = blah
Makes them fail. :(
The question is now: how can the delegate be evaluated for the
return value but not for the enum?
On Thursday, 3 July 2014 at 02:02:19 UTC, safety0ff wrote:
On Thursday, 3 July 2014 at 01:55:14 UTC, safety0ff wrote:
Actually, this is an enhancement because adding:
enum b = blah
Makes them fail. :(
The question is now: how can the delegate be evaluated for the
return value but not for
Hi,
I want to spawn several similar tasks and then wait for all of
them to complete to go on do some other things, like:
```d
void task(int id)
{
// do the stuff
}
void main()
{
foreach (i; 0..10) {
spawn(task, i);
}
wait(?); // wait for all task to complete
I've been trying to figure DUB out and have been having a bit of
trouble. I'm trying to make a simple program that uses Derelict
GL3 and SDL2. I keep getting this error though:
On 07/02/2014 08:29 PM, Puming wrote:
I want to spawn several similar tasks and then wait for all of them to
complete to go on do some other things
If you don't care about account for each of them individually,
core.thread.thread_joinAll would work. The following program starts two
waves of
27 matches
Mail list logo