Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.h

    rf6f0cca3 r4a161be  
    2424class Expression;
    2525
    26 class GC;
    27 
    2826namespace ResolvExpr {
    2927        struct Alternative {
     
    3230                Alternative( Expression *expr, const TypeEnvironment &env, const Cost &cost, const Cost &cvtCost );
    3331                Alternative( const Alternative &other );
    34                 Alternative & operator= ( const Alternative &other );
    35                 Alternative( Alternative&& other ) = default;
    36                 Alternative & operator= ( Alternative&& other ) = default;
     32                Alternative &operator=( const Alternative &other );
     33                Alternative( Alternative && other );
     34                Alternative &operator=( Alternative && other );
     35                ~Alternative();
    3736
    3837                void print( std::ostream &os, Indenter indent = {} ) const;
    3938
     39                /// Returns the stored expression, but released from management of this Alternative
     40                Expression* release_expr() {
     41                        Expression* tmp = expr;
     42                        expr = nullptr;
     43                        return tmp;
     44                }
     45
    4046                Cost cost;
    4147                Cost cvtCost;
    42                 Expression * expr;
     48                Expression *expr;
    4349                TypeEnvironment env;
    4450        };
     
    5662                return os;
    5763        }
    58 
    59         const GC& operator<< ( const GC&, const Alternative& );
    6064} // namespace ResolvExpr
    6165
Note: See TracChangeset for help on using the changeset viewer.