Skip to content

Commit

Permalink
#1469: utils: implement base appender to reduce header deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jun 13, 2021
1 parent 13a5490 commit b190f49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vt/utils/json/json_appender.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#if !defined INCLUDED_VT_UTILS_JSON_JSON_APPENDER_H
#define INCLUDED_VT_UTILS_JSON_JSON_APPENDER_H

#include "vt/utils/json/base_appender.h"
#include "vt/utils/json/output_adaptor.h"

#include <nlohmann/json.hpp>
Expand All @@ -60,7 +61,7 @@ namespace vt { namespace util { namespace json {
* array until it is destroyed.
*/
template <typename StreamLike>
struct Appender {
struct Appender : BaseAppender {
using jsonlib = nlohmann::json;
using SerializerType = nlohmann::detail::serializer<jsonlib>;
using AdaptorType = util::json::OutputAdaptor<StreamLike>;
Expand Down Expand Up @@ -109,7 +110,7 @@ struct Appender {
/**
* \brief Finalize the output, closing the array, and flushing the stream
*/
~Appender() {
virtual ~Appender() {
oa_->write_character(']');
oa_->write_character('}');
// causes the final flush to happen
Expand Down

0 comments on commit b190f49

Please sign in to comment.