Changeset 148ba7d for src/AST


Ignore:
Timestamp:
Oct 25, 2021, 2:29:16 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
c600df1
Parents:
a36eb2d
Message:

Added a return value to WithGuards::GuardValue? so you can save the old value and set a new one in one statement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/AST/Pass.hpp

    ra36eb2d r148ba7d  
    348348
    349349        /// When this node is finished being visited, restore the value of a variable
     350        /// You may assign to the return value to set the new value in the same statement.
    350351        template< typename T >
    351         void GuardValue( T& val ) {
     352        T& GuardValue( T& val ) {
    352353                at_cleanup( [ val ]( void * newVal ) {
    353354                        * static_cast< T * >( newVal ) = val;
    354355                }, static_cast< void * >( & val ) );
     356                return val;
    355357        }
    356358
Note: See TracChangeset for help on using the changeset viewer.