source: src/ResolvExpr/WidenMode.h @ 6ece306

ADT
Last change on this file since 6ece306 was 5bf3976, checked in by Andrew Beach <ajbeach@…>, 22 months ago

Header Clean-Up: Created new headers for new AST typeops and moved declarations.

  • Property mode set to 100644
File size: 1.3 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        struct WidenMode {
20                WidenMode( bool first, bool second ): first( first ), second( second ) {}
21
22                WidenMode &operator|=( const WidenMode &other ) {
23                        first |= other.first; second |= other.second; return *this;
24                }
25
26                WidenMode &operator&=( const WidenMode &other ) {
27                        first &= other.first; second &= other.second; return *this;
28                }
29
30                WidenMode operator|( const WidenMode &other ) {
31                        WidenMode newWM( *this ); newWM |= other; return newWM;
32                }
33
34                WidenMode operator&( const WidenMode &other ) {
35                        WidenMode newWM( *this ); newWM &= other; return newWM;
36                }
37
38                operator bool() { return first && second; }
39
40                bool first : 1, second : 1;
41        };
42
43        static inline WidenMode noWiden() { return { false, false }; }
44} // namespace ResolvExpr
45
46// Local Variables: //
47// tab-width: 4 //
48// mode: c++ //
49// compile-command: "make install" //
50// End: //
Note: See TracBrowser for help on using the repository browser.