Node.Pair opCmp hack due to a DMD 2.054 linker error bug.

This commit is contained in:
Ferdinand Majerech 2013-12-17 15:17:15 +01:00
parent 3a4d1e7627
commit 369c899e90

View file

@ -142,8 +142,6 @@ struct Node
Node value;
public:
@disable int opCmp(ref Pair);
///Construct a Pair from two values. Will be converted to Nodes if needed.
this(K, V)(K key, V value) @safe
{
@ -185,8 +183,18 @@ struct Node
return keyCmp != 0 ? keyCmp
: value.cmp!useTag(rhs.value);
}
// @disable causes a linker error with DMD 2.054, so we temporarily use
// a private opCmp. Apparently this must also match the attributes of
// the Node's opCmp to avoid a linker error.
@disable int opCmp(ref Pair);
int opCmp(ref const(Pair) pair) const @safe
{
assert(false, "This should never be called");
}
}
package:
//YAML value type.
alias Algebraic!(YAMLNull, YAMLMerge, bool, long, real, ubyte[], SysTime, string,