]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/visitor.h
Use default member initializers for simple types
[libs/gl.git] / source / glsl / visitor.h
index ed2534cb31b865900e142a141632fc4f35be497a..622a4834910d9d1f1a1f8e74db8c06af6c29a506 100644 (file)
@@ -13,9 +13,9 @@ namespace SL {
 class NodeVisitor
 {
 protected:
-       NodeVisitor() { }
+       NodeVisitor() = default;
 public:
-       virtual ~NodeVisitor() { }
+       virtual ~NodeVisitor() = default;
 
        virtual void visit(Block &) { }
        virtual void visit(Literal &) { }
@@ -50,9 +50,9 @@ public:
 class TraversingVisitor: public NodeVisitor
 {
 protected:
-       Block *current_block;
+       Block *current_block = 0;
 
-       TraversingVisitor(): current_block(0) { }
+       TraversingVisitor() = default;
 
 public:
        virtual void enter(Block &) { }
@@ -81,13 +81,11 @@ public:
 class NodeRemover: private TraversingVisitor
 {
 private:
-       Stage *stage;
-       const std::set<Node *> *to_remove;
-       bool recursive_remove;
+       Stage *stage = 0;
+       const std::set<Node *> *to_remove = 0;
+       bool recursive_remove = false;
 
 public:
-       NodeRemover();
-
        void apply(Stage &, const std::set<Node *> &);
 
 private:
@@ -110,12 +108,10 @@ on the same hierarchly level as the target node are reordered. */
 class NodeReorderer: private TraversingVisitor
 {
 private:
-       Node *reorder_before;
-       const std::set<Node *> *to_reorder;
+       Node *reorder_before = 0;
+       const std::set<Node *> *to_reorder = 0;
 
 public:
-       NodeReorderer();
-
        void apply(Stage &, Node &, const std::set<Node *> &);
 
 private: