Changes in src/AST/Node.hpp [8abee136:76ed81f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Node.hpp
r8abee136 r76ed81f 94 94 std::ostream& operator<< ( std::ostream& out, const Node * node ); 95 95 96 /// Call a visitor on a possibly-null node 97 template<typename node_t> 98 auto maybe_accept( const node_t * n, Visitor & v ) -> decltype( n->accept(v) ) { 99 return n ? n->accept( v ) : nullptr; 100 } 101 96 102 /// Base class for the smart pointer types 97 103 /// should never really be used. … … 115 121 template<typename o_node_t> 116 122 ptr_base & operator=( const o_node_t * node ) { 117 assign( node ? strict_dynamic_cast<const node_t *>(node) : nullptr);123 assign(strict_dynamic_cast<const node_t *>(node)); 118 124 return *this; 119 125 } … … 140 146 template<typename o_node_t> 141 147 const o_node_t * as() const { return dynamic_cast<const o_node_t *>(node); } 148 149 /// Returns a mutable version of the pointer in this node. 150 node_t * get_and_mutate(); 142 151 143 152 /// Sets this pointer to a mutated version of a pointer (possibly) owned elsehere.
Note: See TracChangeset
for help on using the changeset viewer.