Queue no longer supports types with destructors.
This commit is contained in:
parent
7539b40d3d
commit
078269be36
|
@ -30,6 +30,7 @@ package:
|
||||||
/// implementing a range, as this is used only as a placeholder until Phobos gets a
|
/// implementing a range, as this is used only as a placeholder until Phobos gets a
|
||||||
/// decent replacement.
|
/// decent replacement.
|
||||||
struct Queue(T)
|
struct Queue(T)
|
||||||
|
if(!hasMember!(T, "__dtor"))
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
/// Linked list node containing one element and pointer to the next node.
|
/// Linked list node containing one element and pointer to the next node.
|
||||||
|
@ -217,7 +218,6 @@ void free(T)(T* ptr) @system nothrow
|
||||||
{
|
{
|
||||||
// GC doesn't need to care about any references in this struct anymore.
|
// GC doesn't need to care about any references in this struct anymore.
|
||||||
static if(hasIndirections!T) { GC.removeRange(cast(void*)ptr); }
|
static if(hasIndirections!T) { GC.removeRange(cast(void*)ptr); }
|
||||||
static if(hasMember!(T, "__dtor")) { (*ptr).destroy; }
|
|
||||||
core.stdc.stdlib.free(ptr);
|
core.stdc.stdlib.free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue