Fix passing temporary to Reflector::push()

This commit is contained in:
Martchus 2017-10-28 18:29:15 +02:00
parent 104e362762
commit 0520341411
1 changed files with 2 additions and 1 deletions

View File

@ -182,7 +182,8 @@ void JsonReflectorTests::testSerializePrimitives()
Document::Array array(doc.GetArray());
// string
Reflector::push<string>("foo"s, array, alloc);
const string foo("foo"); // musn't be destroyed until JSON is actually written
Reflector::push<string>(foo, array, alloc);
Reflector::push<const char *>("bar", array, alloc);
// number
Reflector::push<int>(25, array, alloc);