add Loader.opApply overload for @safe delegates
This commit is contained in:
parent
5757869e9a
commit
799a27a99f
|
@ -233,7 +233,18 @@ struct Loader
|
||||||
*
|
*
|
||||||
* Throws: YAMLException on a parsing error.
|
* 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
|
in
|
||||||
{
|
{
|
||||||
assert(!done_, "Loader: Trying to load YAML twice");
|
assert(!done_, "Loader: Trying to load YAML twice");
|
||||||
|
@ -262,8 +273,6 @@ struct Loader
|
||||||
.format(name_, e.msg));
|
.format(name_, e.msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
package:
|
|
||||||
// Scan and return all tokens. Used for debugging.
|
// Scan and return all tokens. Used for debugging.
|
||||||
Token[] scan() @safe
|
Token[] scan() @safe
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue