Changes in src/AST/Node.hpp [2377ca2:a488783]
- File:
-
- 1 edited
-
src/AST/Node.hpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Node.hpp
r2377ca2 ra488783 10 10 // Created On : Wed May 8 10:27:04 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Mar 25 10:33:00 202213 // Update Count : 712 // Last Modified On : Fri Jun 5 9:47:00 2020 13 // Update Count : 6 14 14 // 15 15 … … 103 103 104 104 /// Mutate a node field (only clones if not equal to existing value) 105 template<typename node_t, typename super_t, typename field_t, typename assn_t>106 const node_t * mutate_field( const node_t * node, field_t super_t::* field, assn_t && val ) {105 template<typename node_t, typename parent_t, typename field_t, typename assn_t> 106 const node_t * mutate_field( const node_t * node, field_t parent_t::* field, assn_t && val ) { 107 107 // skip mutate if equivalent 108 108 if ( node->*field == val ) return node; … … 115 115 116 116 /// Mutate a single index of a node field (only clones if not equal to existing value) 117 template<typename node_t, typename super_t, typename coll_t, typename ind_t, typename field_t>117 template<typename node_t, typename parent_t, typename coll_t, typename ind_t, typename field_t> 118 118 const node_t * mutate_field_index( 119 const node_t * node, coll_t super_t::* field, ind_t i, field_t && val119 const node_t * node, coll_t parent_t::* field, ind_t i, field_t && val 120 120 ) { 121 121 // skip mutate if equivalent … … 129 129 130 130 /// Mutate an entire indexed collection by cloning to accepted value 131 template<typename node_t, typename super_t, typename coll_t>132 const node_t * mutate_each( const node_t * node, coll_t super_t::* field, Visitor & v ) {131 template<typename node_t, typename parent_t, typename coll_t> 132 const node_t * mutate_each( const node_t * node, coll_t parent_t::* field, Visitor & v ) { 133 133 for ( unsigned i = 0; i < (node->*field).size(); ++i ) { 134 134 node = mutate_field_index( node, field, i, (node->*field)[i]->accept( v ) ); … … 230 230 } 231 231 232 /// Swaps the nodes contained within two pointers.233 void swap( ptr_base & other ) noexcept;234 235 232 const node_t * get() const { _check(); return node; } 236 233 const node_t * operator->() const { _check(); return node; } … … 295 292 template< typename node_t > 296 293 using readonly = ptr_base< node_t, Node::ref_type::weak >; 297 298 /// Non-member swap that an participate in overload resolution.299 template< typename node_t, enum Node::ref_type ref_t >300 void swap( ptr_base< node_t, ref_t > & l, ptr_base< node_t, ref_t > & r ) {301 l.swap( r );302 }303 304 294 } 305 295
Note:
See TracChangeset
for help on using the changeset viewer.