Changeset 2908f08 for src/ResolvExpr/ResolvMode.h
- Timestamp:
- Nov 17, 2023, 3:03:51 PM (9 months ago)
- Branches:
- master
- Children:
- f7f997a
- Parents:
- 41606df1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ResolvMode.h
r41606df1 r2908f08 17 17 18 18 namespace ResolvExpr { 19 /// Flag set for resolution20 struct ResolvMode {21 const bool adjust; ///< Adjust array and function types to pointer types? [false]22 const bool prune; ///< Prune alternatives to min-cost per return type? [true]23 const bool failFast; ///< Fail on no resulting alternatives? [true]24 19 25 constexpr ResolvMode(bool a, bool p, bool ff) 26 : adjust(a), prune(p), failFast(ff) {} 20 /// Flag set for resolution 21 struct ResolvMode { 22 const bool adjust; ///< Adjust array and function types to pointer types? [false] 23 const bool prune; ///< Prune alternatives to min-cost per return type? [true] 24 const bool failFast; ///< Fail on no resulting alternatives? [true] 27 25 28 /// Default settings 29 constexpr ResolvMode() : adjust(false), prune(true), failFast(true) {} 30 31 /// With adjust flag set; turns array and function types into equivalent pointers 32 static constexpr ResolvMode withAdjustment() { return { true, true, true }; } 26 constexpr ResolvMode(bool a, bool p, bool ff) 27 : adjust(a), prune(p), failFast(ff) {} 33 28 34 /// With adjust flag set but prune unset; pruning ensures there is at least one alternative 35 /// per result type 36 static constexpr ResolvMode withoutPrune() { return { true, false, true }; } 29 /// Default settings 30 constexpr ResolvMode() : adjust(false), prune(true), failFast(true) {} 37 31 38 /// With adjust and prune flags set but failFast unset; failFast ensures there is at least 39 /// one resulting alternative 40 static constexpr ResolvMode withoutFailFast() { return { true, true, false }; } 32 /// With adjust flag set; turns array and function types into equivalent pointers 33 static constexpr ResolvMode withAdjustment() { return { true, true, true }; } 41 34 42 /// The same mode, but with satisfyAssns turned on; for top-level calls 43 ResolvMode atTopLevel() const { return { adjust, true, failFast }; } 44 }; 35 /// With adjust flag set but prune unset; pruning ensures there is at least one alternative 36 /// per result type 37 static constexpr ResolvMode withoutPrune() { return { true, false, true }; } 38 39 /// With adjust and prune flags set but failFast unset; failFast ensures there is at least 40 /// one resulting alternative 41 static constexpr ResolvMode withoutFailFast() { return { true, true, false }; } 42 43 /// The same mode, but with satisfyAssns turned on; for top-level calls 44 ResolvMode atTopLevel() const { return { adjust, true, failFast }; } 45 }; 46 45 47 } // namespace ResolvExpr 46 48
Note: See TracChangeset
for help on using the changeset viewer.