C++QEDCore
v2 Milestone 10
a framework for simulating open quantum dynamics – core
C++QED
|
core
|
elements
|
cpypyqed
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
BooleanNegatedProxy.h
Go to the documentation of this file.
1
// Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
3
// -*- C++ -*-
4
#ifndef CPPQEDCORE_UTILS_BOOLEANNEGATEDPROXY_H_INCLUDED
5
#define CPPQEDCORE_UTILS_BOOLEANNEGATEDPROXY_H_INCLUDED
6
7
#include "BooleanNegatedProxyFwd.h"
8
9
#include <iosfwd>
10
11
namespace
cpputils
{
12
13
15
class
BooleanNegatedProxy
16
{
17
public
:
18
BooleanNegatedProxy
(
bool
& v
19
) : v_(v) {}
20
22
operator
bool()
const
{
return
!v_;}
23
24
BooleanNegatedProxy
& operator=(
const
BooleanNegatedProxy
& other) {v_=other.v_;
return
*
this
;}
25
26
BooleanNegatedProxy
& operator=(
bool
v) {v_=!v;
return
*
this
;}
27
28
private
:
29
bool
&v_;
30
31
};
32
33
34
// std::ostream& operator<<(std::ostream&, const BooleanNegatedProxy&);
35
37
std::istream& operator>>(std::istream&, BooleanNegatedProxy&);
38
39
40
}
// cpputils
41
42
#endif // CPPQEDCORE_UTILS_BOOLEANNEGATEDPROXY_H_INCLUDED
cpputils
Namespace comprising otherwise hard-to-classify generic utilities.
Definition:
Algorithm.h:10
cpputils::BooleanNegatedProxy
Bound to a boolean lvalue, it behaves like a boolean always with opposite value.
Definition:
BooleanNegatedProxy.h:15
cpputils::BooleanNegatedProxy::BooleanNegatedProxy
BooleanNegatedProxy(bool &v)
Definition:
BooleanNegatedProxy.h:18
utils
BooleanNegatedProxy.h
Generated on Wed Mar 30 2016 14:15:14 for C++QEDCore by
1.8.11