Navigation Menu

Skip to content

Commit

Permalink
Add workaround to fix issue 10567
Browse files Browse the repository at this point in the history
Currently VariantN does not support const objects comparison. So just add specialized opCmp member and use cast().
  • Loading branch information
9rnsr committed Jul 9, 2013
1 parent e1504f7 commit 206d6f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions std/variant.d
Expand Up @@ -787,6 +787,12 @@ public:
cast(void*) &temp);
}

// workaround for bug 10567 fix
int opCmp(ref const VariantN rhs) const
{
return (cast()this).opCmp!(VariantN)(cast()rhs);
}

/**
* Ordering comparison used by the "<", "<=", ">", and ">="
* operators. In case comparison is not sensible between the held
Expand Down

0 comments on commit 206d6f7

Please sign in to comment.