https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Bool.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
16struct Bool
17{
18 // If an 'uninitialized' Bool is created, set _value to false
19 Bool() : _value(false) {}
20 Bool(bool b) : _value(b) {}
21
22 // This allows a lot of stuff that works for bool to also work for
23 // Bool, like cout.
24 operator bool &() { return _value; }
25 operator const bool &() const { return _value; }
26
27 Bool & operator=(const bool & other)
28 {
29 _value = other;
30 return *this;
31 }
32
33 bool _value;
34};
A wrapper for the C++ boolean type which can be stored in vectors in the same way as other C++ types.
Definition Bool.h:17
Bool()
Definition Bool.h:19
Bool(bool b)
Definition Bool.h:20
bool _value
Definition Bool.h:33
Bool & operator=(const bool &other)
Definition Bool.h:27