summaryrefslogtreecommitdiff
path: root/dmagick
diff options
context:
space:
mode:
authorMike Wey2012-02-15 22:03:30 +0100
committerMike Wey2012-02-15 22:03:30 +0100
commitc575c1af3d6d6549fce69514eaa6de5392e5f9bf (patch)
treebbc427dbe4096f4eb2e4c3d7a6ffd5eeecbe51ce /dmagick
parentba163e3e4621a7790f07421b53c007d83e705bbd (diff)
Add an opCast for Object.
This is needed for dmd 2.058 and up.
Diffstat (limited to 'dmagick')
-rw-r--r--dmagick/Color.d9
1 files changed, 9 insertions, 0 deletions
diff --git a/dmagick/Color.d b/dmagick/Color.d
index c9ea1ee..cb17cf0 100644
--- a/dmagick/Color.d
+++ b/dmagick/Color.d
@@ -133,6 +133,15 @@ class Color
assert(color.toString() == "#0000000000000000FFFFFFFF");
}
+ /*
+ * Needed when comparing colors with dmd 2.058.
+ */
+ Object opCast(T)()
+ if ( is(T == Object) )
+ {
+ return this;
+ }
+
/**
* Support casting between different colors.
* You can also use std.conv.to