Merge pull request #109 from Herringway/serializer-safe-constructor
fix Serializer.this using address of ref parameter merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
commit
4437a22430
|
@ -276,7 +276,7 @@ struct Dumper
|
|||
try
|
||||
{
|
||||
auto emitter = Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_);
|
||||
auto serializer = Serializer(emitter, resolver_, encoding_, explicitStart_,
|
||||
auto serializer = Serializer(&emitter, resolver_, encoding_, explicitStart_,
|
||||
explicitEnd_, YAMLVersion_, tags_);
|
||||
foreach(ref document; documents)
|
||||
{
|
||||
|
|
|
@ -66,12 +66,12 @@ struct Serializer
|
|||
* YAMLVersion = YAML version string.
|
||||
* tagDirectives = Tag directives to emit.
|
||||
*/
|
||||
this(ref Emitter emitter, Resolver resolver, Encoding encoding,
|
||||
this(Emitter* emitter, Resolver resolver, Encoding encoding,
|
||||
const Flag!"explicitStart" explicitStart,
|
||||
const Flag!"explicitEnd" explicitEnd, string YAMLVersion,
|
||||
TagDirective[] tagDirectives) @trusted
|
||||
TagDirective[] tagDirectives) @safe
|
||||
{
|
||||
emitter_ = &emitter;
|
||||
emitter_ = emitter;
|
||||
resolver_ = resolver;
|
||||
explicitStart_ = explicitStart;
|
||||
explicitEnd_ = explicitEnd;
|
||||
|
|
Loading…
Reference in a new issue