Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8d7bef2
Parents:
6171841
git-author:
Aaron Moss <a3moss@…> (03/16/18 17:04:24)
git-committer:
Aaron Moss <a3moss@…> (03/16/18 17:15:02)
Message:

First pass at delete removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.cc

    r6171841 r68f9c43  
    3434        Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost, const Cost &cvtCost )
    3535                : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {}
    36 
    37         Alternative::Alternative( const Alternative &other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( maybeClone( other.expr ) ), env( other.env ) {
    38         }
    39 
    40         Alternative &Alternative::operator=( const Alternative &other ) {
    41                 if ( &other == this ) return *this;
    42                 delete expr;
    43                 cost = other.cost;
    44                 cvtCost = other.cvtCost;
    45                 expr = maybeClone( other.expr );
    46                 env = other.env;
    47                 return *this;
    48         }
    49 
    50         Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( other.env ) {
    51                 other.expr = nullptr;
    52         }
    53 
    54         Alternative & Alternative::operator=( Alternative && other ) {
    55                 if ( &other == this )  return *this;
    56                 delete expr;
    57                 cost = other.cost;
    58                 cvtCost = other.cvtCost;
    59                 expr = other.expr;
    60                 env = other.env;
    61                 other.expr = nullptr;
    62                 return *this;
    63         }
    64 
    65         Alternative::~Alternative() {
    66                 delete expr;
    67         }
    6836
    6937        void Alternative::print( std::ostream &os, Indenter indent ) const {
Note: See TracChangeset for help on using the changeset viewer.