Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.hpp

    r54e41b3 r3648d98  
    99// Author           : Thierry Delisle
    1010// Created On       : Wed May 8 10:27:04 2019
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May 15 16:02:00 2019
    13 // Update Count     : 3
     11// Last Modified By : Aaron B. Moss
     12// Last Modified On : Wed May 8 11:00:00 2019
     13// Update Count     : 2
    1414//
    1515
     
    7676// problems and be able to use auto return
    7777template<typename node_t>
    78 auto mutate( const node_t * node ) {
     78auto mutate(const node_t * node) {
    7979        assertf(
    8080                node->strong_count >= 1,
     
    9292}
    9393
    94 std::ostream& operator<< ( std::ostream& out, const Node * node );
     94std::ostream& operator<< ( std::ostream& out, const Node* node );
    9595
    9696/// Base class for the smart pointer types
     
    137137        operator const node_t * () const { return node; }
    138138
    139         /// wrapper for convenient access to dynamic_cast
    140139        template<typename o_node_t>
    141140        const o_node_t * as() const { return dynamic_cast<const o_node_t *>(node); }
    142 
    143         /// Sets this pointer to a mutated version of a pointer (possibly) owned elsehere.
    144         /// Returns a mutable version of the pointer in this node.
    145         node_t * set_and_mutate( const node_t * n ) {
    146                 // ensure ownership of `n` by this node to avoid spurious single-owner mutates
    147                 assign( n );
    148                 // get mutable version of `n`
    149                 auto r = mutate( node );
    150                 // re-assign mutable version in case `mutate()` produced a new pointer
    151                 assign( r );
    152                 return r;
    153         }
    154141
    155142        using ptr = const node_t *;
Note: See TracChangeset for help on using the changeset viewer.