Re: GC and MMM

2015-08-20 Thread luminousone via Digitalmars-d-learn
On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote: Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya Yes, just don't store any GC managed

Re: How to turn this C++ into D?

2014-11-05 Thread luminousone via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 18:18:18 UTC, Ali Çehreli wrote: On 11/05/2014 10:12 AM, Adam D. Ruppe wrote: On Wednesday, 5 November 2014 at 18:10:38 UTC, Ali Çehreli wrote: If so, then that push_back would be adding an incomplete object to the list. scope(success)? I really like that!

Re: How to turn this C++ into D?

2014-11-05 Thread luminousone via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 19:05:32 UTC, Patrick Jeeves wrote: On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone wrote: unless delete is explicitly called, I don't believe the destructor would ever be called, it would still have a reference in the static foo_list object

Re: How to turn this C++ into D?

2014-11-05 Thread luminousone via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 20:31:54 UTC, Patrick Jeeves wrote: On Wednesday, 5 November 2014 at 19:44:57 UTC, luminousone wrote: On Wednesday, 5 November 2014 at 19:05:32 UTC, Patrick Jeeves wrote: On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone wrote: unless delete

Re: Traits

2013-10-12 Thread luminousone
On Saturday, 12 October 2013 at 05:38:16 UTC, Jonathan M Davis wrote: On Friday, October 11, 2013 22:31:25 Jonathan M Davis wrote: On Saturday, October 12, 2013 00:54:48 luminousone wrote: The inability to handle null is pretty big, specially considering that at not point is the class

Re: Traits

2013-10-12 Thread luminousone
On Saturday, 12 October 2013 at 07:47:18 UTC, Jonathan M Davis wrote: On Saturday, October 12, 2013 09:32:09 luminousone wrote: And again, the casting solution is a bloody hack, it is loaded with corner cases that will break things if you are not aware of them. It also requires an allocated

Re: Traits

2013-10-12 Thread luminousone
On Saturday, 12 October 2013 at 23:48:56 UTC, Artur Skawina wrote: On 10/12/13 21:42, luminousone wrote: On Saturday, 12 October 2013 at 11:50:05 UTC, Artur Skawina wrote: template isBaseOf(BASE, C) { enum isBaseOf = { static if (is(C S == super)) foreach (A; S

Re: Traits

2013-10-11 Thread luminousone
On Friday, 11 October 2013 at 09:37:33 UTC, Jacob Carlborg wrote: On 2013-10-11 07:49, luminousone wrote: import std.traits; bool ChildInheritsFromParent( parent, child )( ) { foreach ( k, t; BaseClassesTuple!child ) { if( typeid(t) == typeid(parent) ) return true

Re: Traits

2013-10-11 Thread luminousone
On Friday, 11 October 2013 at 14:09:09 UTC, Gary Willoughby wrote: On Friday, 11 October 2013 at 05:49:38 UTC, luminousone wrote: On Friday, 11 October 2013 at 04:13:55 UTC, Agustin wrote: I have a function that needs to check if the template provided inherit a class. For example: public

Re: Traits

2013-10-11 Thread luminousone
On Friday, 11 October 2013 at 19:54:39 UTC, Jonathan M Davis wrote: On Friday, October 11, 2013 21:19:29 luminousone wrote: Using casts that way won't always be correct, it would be better to use reflection in some way if possible. The only reason that the casts wouldn't be correct would

Re: Traits

2013-10-11 Thread luminousone
On Friday, 11 October 2013 at 21:49:50 UTC, Jonathan M Davis wrote: On Friday, October 11, 2013 23:06:53 luminousone wrote: On Friday, 11 October 2013 at 19:54:39 UTC, Jonathan M Davis wrote: On Friday, October 11, 2013 21:19:29 luminousone wrote: Using casts that way won't always be correct

Re: Traits

2013-10-10 Thread luminousone
On Friday, 11 October 2013 at 04:13:55 UTC, Agustin wrote: I have a function that needs to check if the template provided inherit a class. For example: public void function(T, A...)(auto ref A values) { // static assert(IsBaseOf(L, T)); } Check if T inherit class L. Same result that

Re: improve concurrent queue

2013-08-27 Thread luminousone
On Tuesday, 27 August 2013 at 17:35:13 UTC, qznc wrote: On Monday, 26 August 2013 at 19:35:28 UTC, luminousone wrote: I have been working on a project and needed a good concurrent queue What does good mean? Concurrent queues have so many design parameters (single reader? single writer

improve concurrent queue

2013-08-26 Thread luminousone
I have been working on a project and needed a good concurrent queue, so I wrote one, is their anyone more familiar with the atomic arts that could tell me if their is anyway i can further improve it. module container.concurrentqueue; import std.typetuple; import core.atomic; class