From c12eebb3c812ea6ed2f523ce9fbb0e142d431a41 Mon Sep 17 00:00:00 2001 From: alexrp Date: Wed, 23 May 2012 03:08:30 +0200 Subject: [PATCH] @trusted pure nothrow const in some parts of std.variant. --- std/variant.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/std/variant.d b/std/variant.d index 366d538dd..2d9552669 100644 --- a/std/variant.d +++ b/std/variant.d @@ -71,6 +71,8 @@ import std.traits, std.c.string, std.typetuple, std.conv, std.exception; import std.exception, std.stdio; //} +@trusted: + private template maxSize(T...) { static if (T.length == 1) @@ -560,7 +562,7 @@ public: * ---- */ - @property bool hasValue() const + @property bool hasValue() const pure nothrow { // @@@BUG@@@ in compiler, the cast shouldn't be needed return cast(typeof(&handler!(void))) fptr != &handler!(void); @@ -608,7 +610,7 @@ public: * $(LINK2 std_traits.html#ImplicitConversionTargets,ImplicitConversionTargets). */ - @property bool convertsTo(T)() + @property bool convertsTo(T)() const { TypeInfo info = typeid(T); return fptr(OpID.testConversion, null, &info) == 0;