On Thursday, 30 June 2016 at 21:53:42 UTC, Jordan Wilson wrote:
Hello,
For tuples, does the fieldNames property have a 1-1
correspondence with the Types property?
It appears that way in my testing:
alias MyData = Tuple!(string,"a",int,"b");
foreach (i, type; MyData.Types){
writeln
On Thursday, 30 June 2016 at 21:53:42 UTC, Jordan Wilson wrote:
Hello,
For tuples, does the fieldNames property have a 1-1
correspondence with the Types property?
It appears that way in my testing:
alias MyData = Tuple!(string,"a",int,"b");
foreach (i, type; MyData.Types){
writeln
On Thursday, 30 June 2016 at 20:11:17 UTC, Mike Wey wrote:
Is the complete source available some ware?
Yes, here: http://pastebin.com/h0Nx1mL6
How can I get the program stats at run time such as minimum and
maximum amount of memory and cpu used, cpu architecture, os, etc?
Hello,
For tuples, does the fieldNames property have a 1-1
correspondence with the Types property?
It appears that way in my testing:
alias MyData = Tuple!(string,"a",int,"b");
foreach (i, type; MyData.Types){
writeln (MyData.fieldNames[i]," ",type.stringof);
// a string
// b int
On Thursday, 30 June 2016 at 17:08:45 UTC, Jonathan Marler wrote:
Is there a way to have an associative array of const values? I
thought it would have been:
const(T)[K] map;
map[x] = y;
but the second line gives Error: cannot modify const
expression. I would think that the const(T)[K] would
On Monday, 24 October 2011 at 15:29:41 UTC, Jonathan M Davis
wrote:
On Friday, October 07, 2011 19:58:12 Joel Christensen wrote:
> http://d-programming-language.org/intro-to-datetime.html
Thanks Jonathan, that helped I think, (haven't read it all,
though). But I've got errors with some of the
On 06/30/2016 08:53 AM, TheDGuy wrote:
On Wednesday, 29 June 2016 at 10:41:21 UTC, TheDGuy wrote:
I tried to debug a little and what i don't understand is, that i get
two times 'blue' on the console, even though yellow and blue lit up
but yellow stayed at the flash color:
private void
Is there a way to have an associative array of const values? I
thought it would have been:
const(T)[K] map;
map[x] = y;
but the second line gives Error: cannot modify const expression.
I would think that the const(T)[K] would behave similarly to
const(T)[], where you can modify the array,
On Thursday, 30 June 2016 at 00:25:53 UTC, Jonathan Marler wrote:
I'd like to hear peoples thoughts on the various solutions for
the following problem. Say you have some hierarchy of classes
like:
class GameObject {
// ...
}
class Entity : GameObject {
// ...
}
class Player : Entity {
On Thursday, 30 June 2016 at 00:27:57 UTC, rikki cattermole wrote:
On 30/06/2016 12:25 PM, Jonathan Marler wrote:
Assume you have a function that accepts a GameObject but does
something
special if that GameObject happens to be an instance of the
Player
class. How would you go about determining
On Thursday, 30 June 2016 at 01:11:09 UTC, Mike Parker wrote:
I think it's safe to say this guy is just trolling and we can
ignore him.
I was about to say the same, Mike. He is either trolling, or
genuinely did not even bother to learn some language basics...
On 6/30/16 10:10 AM, jj75607 wrote:
For example I have a shared from different threads variable. What piece
of code is correctly thread-safe?
First:
shared class A
{
shared(int) x;
Note, no need to mark x shared. 'A' implicitly shares everything.
void test1()
{
For example I have a shared from different threads variable. What
piece of code is correctly thread-safe?
First:
shared class A
{
shared(int) x;
void test1()
{
x = 10;
x += 5
writeln(x);
}
}
Or second:
import core.atomic;
shared
On 6/30/16 8:41 AM, jj75607 wrote:
On Thursday, 30 June 2016 at 12:25:54 UTC, Steven Schveighoffer wrote:
On 6/30/16 8:18 AM, jj75607 wrote:
[...]
You don't need to mark this shared, because the entire class is
shared, all members are implicitly marked shared.
[...]
Thanks! Is this
On Thursday, 30 June 2016 at 12:25:54 UTC, Steven Schveighoffer
wrote:
On 6/30/16 8:18 AM, jj75607 wrote:
[...]
You don't need to mark this shared, because the entire class is
shared, all members are implicitly marked shared.
[...]
Thanks! Is this a compilation only 'cast' with no
On 6/30/16 8:30 AM, jj75607 wrote:
On Thursday, 30 June 2016 at 12:21:03 UTC, Steven Schveighoffer wrote:
On 6/30/16 6:26 AM, jj75607 wrote:
Hello!
I need to overload opEquals on shared class C
shared class C
{
override bool opEquals(Object o) { return false; }
}
But compilation fails
On Thursday, 30 June 2016 at 12:21:03 UTC, Steven Schveighoffer
wrote:
On 6/30/16 6:26 AM, jj75607 wrote:
Hello!
I need to overload opEquals on shared class C
shared class C
{
override bool opEquals(Object o) { return false; }
}
But compilation fails with the message:
Error: function
On 6/30/16 8:18 AM, jj75607 wrote:
I wrote shared class with rwmutex
import core.sync.rwmutex;
shared class Shared
{
ReadWriteMutex rwmutex;
int[] items;
this()
{
rwmutex = new ReadWriteMutex();
}
}
But it fails with:
Error: cannot implicitly
On 6/30/16 6:26 AM, jj75607 wrote:
Hello!
I need to overload opEquals on shared class C
shared class C
{
override bool opEquals(Object o) { return false; }
}
But compilation fails with the message:
Error: function f700.C.opEquals does not override any function, did you
mean to override
I wrote shared class with rwmutex
import core.sync.rwmutex;
shared class Shared
{
ReadWriteMutex rwmutex;
int[] items;
this()
{
rwmutex = new ReadWriteMutex();
}
}
But it fails with:
Error: cannot implicitly convert expression (new
On Thursday, 30 June 2016 at 02:39:22 UTC, JS wrote:
I created a type that makes working with flags much easier.
Please review for issues and enhancements. It would be nice to
simplify the value size code.
[...]
You can look at this, it's more or less the same concept:
Hello!
I need to overload opEquals on shared class C
shared class C
{
override bool opEquals(Object o) { return false; }
}
But compilation fails with the message:
Error: function f700.C.opEquals does not override any function,
did you mean to override 'object.Object.opEquals'?
What am I
On 06/30/2016 04:39 AM, JS wrote:
struct EnumToFlags(alias E)
{
import std.traits, std.conv, std.string, std.algorithm, std.array;
static if (E.max < 8)
alias vtype = ubyte;
Convention says: Capitalize user-defined type names. So it should be
"Vtype" or maybe "VType"
On Monday, 27 June 2016 at 21:58:04 UTC, "Smoke" Adams wrote:
I'm in need of a way to create a local array that isn't GC'ed.
It must be dynamic in the sense of setting the size at compile
time but it will be used only in scope and only on structs.
`alloca` is made for that purpose.
On Wednesday, 29 June 2016 at 10:41:21 UTC, TheDGuy wrote:
I tried to debug a little and what i don't understand is, that
i get two times 'blue' on the console, even though yellow and
blue lit up but yellow stayed at the flash color:
private void letButtonsFlash(){
foreach(Button
26 matches
Mail list logo