From: Mikko Rasa Date: Thu, 12 Sep 2019 19:34:15 +0000 (+0300) Subject: Appease the compiler with some extra copy-ctor's and operator='s X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=caad9bd997e95b3ccdf496313588b8480ebfddfa Appease the compiler with some extra copy-ctor's and operator='s In C++11 if you manually define either a copy constructor or an assignment operator, you must define the other as well. --- diff --git a/source/programsyntax.h b/source/programsyntax.h index 59042951..e7b5111e 100644 --- a/source/programsyntax.h +++ b/source/programsyntax.h @@ -20,6 +20,9 @@ struct NodeVisitor; struct Node { +protected: + Node() { } + Node(const Node &) { } private: Node &operator=(const Node &); public: @@ -36,6 +39,7 @@ public: NodePtr() { } NodePtr(T *p): RefPtr(p) { } NodePtr(const NodePtr &p): RefPtr(p ? p->clone() : 0) { } + NodePtr &operator=(const NodePtr &p) { RefPtr::operator=(p); return *this; } template NodePtr(const RefPtr &p): RefPtr(p) { }