From e88b716d89ca197e9e57234f96d9effeba5eaa35 Mon Sep 17 00:00:00 2001 From: Kiith-Sa Date: Wed, 16 Oct 2013 23:14:37 +0200 Subject: [PATCH] Nothrow Node.type and Node.isType. --- source/dyaml/node.d | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/dyaml/node.d b/source/dyaml/node.d index 6b2599f..bccb357 100644 --- a/source/dyaml/node.d +++ b/source/dyaml/node.d @@ -1629,14 +1629,21 @@ struct Node } //Get type of the node value (YAMLObject for user types). - @property TypeInfo type() const @safe {return value_.type;} + @property TypeInfo type() const @trusted nothrow + { + alias TypeInfo delegate() const nothrow nothrowType; + return (cast(nothrowType)&value_.type)(); + } /* * Determine if the value stored by the node is of specified type. * * This only works for default YAML types, not for user defined types. */ - @property bool isType(T)() const @safe {return value_.type is typeid(Unqual!T);} + @property bool isType(T)() const @safe nothrow + { + return this.type is typeid(Unqual!T); + } private: //Is the value a bool?