Last change
on this file since 16afb2a was
2908f08,
checked in by Andrew Beach <ajbeach@…>, 12 months ago
|
Most of ResolvExpr? was written before the new style standard. Some files updated, focus on headers.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[d286cf68] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
| 7 | // WidenMode.h -- |
---|
| 8 | // |
---|
| 9 | // Author : Aaron B. Moss |
---|
| 10 | // Created On : Mon Jun 18 11:58:00 2018 |
---|
| 11 | // Last Modified By : Aaron B. Moss |
---|
| 12 | // Last Modified On : Mon Jun 18 11:58:00 2018 |
---|
| 13 | // Update Count : 1 |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
| 18 | namespace ResolvExpr { |
---|
[5bf3976] | 19 | |
---|
[2908f08] | 20 | struct WidenMode { |
---|
| 21 | WidenMode( bool first, bool second ): first( first ), second( second ) {} |
---|
[d286cf68] | 22 | |
---|
[2908f08] | 23 | WidenMode &operator|=( const WidenMode &other ) { |
---|
| 24 | first |= other.first; second |= other.second; return *this; |
---|
| 25 | } |
---|
[f474e91] | 26 | |
---|
[2908f08] | 27 | WidenMode &operator&=( const WidenMode &other ) { |
---|
| 28 | first &= other.first; second &= other.second; return *this; |
---|
| 29 | } |
---|
[f474e91] | 30 | |
---|
[2908f08] | 31 | WidenMode operator|( const WidenMode &other ) { |
---|
| 32 | WidenMode newWM( *this ); newWM |= other; return newWM; |
---|
| 33 | } |
---|
[5bf3976] | 34 | |
---|
[2908f08] | 35 | WidenMode operator&( const WidenMode &other ) { |
---|
| 36 | WidenMode newWM( *this ); newWM &= other; return newWM; |
---|
| 37 | } |
---|
[f474e91] | 38 | |
---|
[2908f08] | 39 | operator bool() { return first && second; } |
---|
| 40 | |
---|
| 41 | bool first : 1, second : 1; |
---|
| 42 | }; |
---|
| 43 | |
---|
| 44 | static inline WidenMode noWiden() { return { false, false }; } |
---|
[ee574a2] | 45 | |
---|
[d286cf68] | 46 | } // namespace ResolvExpr |
---|
| 47 | |
---|
| 48 | // Local Variables: // |
---|
| 49 | // tab-width: 4 // |
---|
| 50 | // mode: c++ // |
---|
| 51 | // compile-command: "make install" // |
---|
| 52 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.