Changeset 8631c84 for src/AST/Node.cpp


Ignore:
Timestamp:
Mar 25, 2022, 11:47:51 AM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
f5bace8
Parents:
94fa946
Message:

Made ast::ptr_base swappable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.cpp

    r94fa946 r8631c84  
    99// Author           : Thierry Delisle
    1010// Created On       : Thu May 16 14:16:00 2019
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  1 09:09:39 2022
    13 // Update Count     : 3
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Mar 25 10:30:00 2022
     13// Update Count     : 4
    1414//
    1515
     
    1919#include <csignal>  // MEMORY DEBUG -- for raise
    2020#include <iostream>
     21#include <utility>
    2122
    2223#include "Attribute.hpp"
     
    7677void ast::ptr_base<node_t, ref_t>::_check() const {
    7778        // if(node) assert(node->was_ever_strong == false || node->strong_count > 0);
     79}
     80
     81template< typename node_t, enum ast::Node::ref_type ref_t >
     82void ast::ptr_base<node_t, ref_t>::swap( ptr_base & other ) noexcept {
     83        std::swap( this->node, other.node );
     84        _trap( this->node );
     85        _trap( other.node );
    7886}
    7987
Note: See TracChangeset for help on using the changeset viewer.