Merge pull request #150 from Herringway/safe-opapply
add Loader.opApply overload for @safe delegates
This commit is contained in:
commit
646315ca4c
|
@ -242,7 +242,18 @@ struct Loader
|
|||
*
|
||||
* Throws: YAMLException on a parsing error.
|
||||
*/
|
||||
int opApply(int delegate(ref Node) dg) @trusted
|
||||
int opApply(int delegate(ref Node) @safe dg) @safe
|
||||
{
|
||||
return opApplyImpl(dg);
|
||||
}
|
||||
/// Ditto
|
||||
int opApply(int delegate(ref Node) @system dg) @system
|
||||
{
|
||||
return opApplyImpl(dg);
|
||||
}
|
||||
|
||||
package:
|
||||
int opApplyImpl(T)(T dg)
|
||||
in
|
||||
{
|
||||
assert(!done_, "Loader: Trying to load YAML twice");
|
||||
|
@ -271,8 +282,6 @@ struct Loader
|
|||
.format(name_, e.msg));
|
||||
}
|
||||
}
|
||||
|
||||
package:
|
||||
// Scan and return all tokens. Used for debugging.
|
||||
Token[] scan() @safe
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue