source: src/ResolvExpr/WidenMode.hpp @ 065de93

Last change on this file since 065de93 was c92bdcc, checked in by Andrew Beach <ajbeach@…>, 6 months ago

Updated the rest of the names in src/ (except for the generated files).

  • Property mode set to 100644
File size: 1.2 KB
Line 
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
18namespace ResolvExpr {
19
20struct WidenMode {
21        WidenMode( bool first, bool second ): first( first ), second( second ) {}
22
23        WidenMode &operator|=( const WidenMode &other ) {
24                first |= other.first; second |= other.second; return *this;
25        }
26
27        WidenMode &operator&=( const WidenMode &other ) {
28                first &= other.first; second &= other.second; return *this;
29        }
30
31        WidenMode operator|( const WidenMode &other ) {
32                WidenMode newWM( *this ); newWM |= other; return newWM;
33        }
34
35        WidenMode operator&( const WidenMode &other ) {
36                WidenMode newWM( *this ); newWM &= other; return newWM;
37        }
38
39        operator bool() { return first && second; }
40
41        bool first : 1, second : 1;
42};
43
44static inline WidenMode noWiden() { return { false, false }; }
45
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.