Ignore:
Timestamp:
Mar 14, 2023, 4:21:05 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
1afd9ccb, 360bfe41, 6e6989c
Parents:
5217569 (diff), c19ca4b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parserutility.h

    r5217569 rdbae916  
    1010// Created On       : Sat May 16 15:31:46 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Feb 16 12:34:00 2023
    13 // Update Count     : 5
     12// Last Modified On : Thr Mar  9 12:16:00 2023
     13// Update Count     : 6
    1414//
    1515
     
    2020Expression *notZeroExpr( Expression *orig );
    2121
    22 template< typename T, typename U >
    23 struct maybeBuild_t {
    24         static T * doit( const U *orig ) {
    25                 if ( orig ) {
    26                         return orig->build();
    27                 } else {
    28                         return 0;
    29                 }
    30         }
    31 };
    32 
    33 template< typename T, typename U >
    34 static inline T * maybeBuild( const U *orig ) {
    35         return maybeBuild_t<T,U>::doit(orig);
     22template< typename T >
     23static inline auto maybeBuild( const T *orig ) -> decltype(orig->build()) {
     24        return (orig) ? orig->build() : nullptr;
    3625}
    3726
    38 template< typename T, typename U >
    39 static inline T * maybeMoveBuild( const U *orig ) {
    40         T* ret = maybeBuild<T>(orig);
     27template< typename T >
     28static inline auto maybeMoveBuild( const T *orig ) -> decltype(orig->build()) {
     29        auto ret = maybeBuild<T>(orig);
    4130        delete orig;
    4231        return ret;
Note: See TracChangeset for help on using the changeset viewer.