From f40de21e5666be6fa456fedc60584bd672d12c44 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 22 Jan 2013 08:29:55 -0800 Subject: Removing some more cruft. --- includes/SimpleMustache.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'includes/SimpleMustache.h') diff --git a/includes/SimpleMustache.h b/includes/SimpleMustache.h index 28cb477..b01955b 100644 --- a/includes/SimpleMustache.h +++ b/includes/SimpleMustache.h @@ -17,7 +17,7 @@ class SimpleMustache { Context & operator[](const char * str); private: Proxy(Context * parent, ssize_t idx) : m_parent(parent), m_idx(idx) { } - Context * m_parent; + Context * m_parent = NULL; ssize_t m_idx; friend class Context; }; @@ -71,6 +71,9 @@ class SimpleMustache { friend class Proxy; friend class SimpleMustache; + + Context(const Context &) = delete; + Context & operator=(const Context &) = delete; }; void setTemplate(IO h); @@ -87,6 +90,7 @@ class SimpleMustache { void render(IO h, Context * ctx) const { AAssert(ctx, "Please pass on a context to render"); render_r(h, ctx, "", m_fragments.begin(), false, -1); } void empty() { while (!m_fragments.empty()) { delete m_fragments.front(); m_fragments.pop_front(); } } void checkTemplate() { Fragments::const_iterator end = checkTemplate_r(m_fragments.begin()); AAssert(end == m_fragments.end(), "The template wasn't fully checked; possibly mismatched sections"); } + SimpleMustache() { } ~SimpleMustache() { empty(); } private: struct Fragment { @@ -108,6 +112,9 @@ class SimpleMustache { static String escape(const String & s); Fragments::const_iterator checkTemplate_r(Fragments::const_iterator begin, const String & endSection = "") const; + + SimpleMustache(const SimpleMustache &) = delete; + SimpleMustache & operator=(const SimpleMustache &) = delete; }; }; -- cgit v1.2.3