itpp
base
binary.cpp
Go to the documentation of this file.
1
29
#include <
itpp/base/binary.h
>
30
#include <iostream>
31
32
33
namespace
itpp
34
{
35
36
std::ostream &
operator<<
(std::ostream &output,
const
bin
&inbin)
37
{
38
output << static_cast<int>(inbin);
39
return
output;
40
}
41
42
std::istream &
operator>>
(std::istream &input,
bin
&outbin)
43
{
44
int
tmp;
45
input >> tmp;
46
it_assert
((tmp == 0) || (tmp == 1),
47
"bin::operator>>(): input value must be 0 or 1"
);
48
outbin = tmp;
49
return
input;
50
}
51
52
}
// namespace itpp
itpp::operator>>
std::istream & operator>>(std::istream &input, bin &outbin)
Input stream of bin.
Definition:
binary.cpp:42
itpp::operator<<
std::ostream & operator<<(std::ostream &output, const bin &inbin)
Output stream of bin.
Definition:
binary.cpp:36
itpp
itpp namespace
Definition:
itmex.h:36
itpp::bin
Binary arithmetic (boolean) class.
Definition:
binary.h:56
binary.h
Binary class definition.
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition:
itassert.h:94
Generated on Mon Mar 23 2020 06:18:03 for IT++ by
Doxygen
1.8.17