src/utilities/core/Optional.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "Optional.hpp" | ||
| 7 | |||
| 8 | namespace openstudio { | ||
| 9 | |||
| 10 | 2 | std::ostream& operator<<(std::ostream& os, const boost::optional<double>& x) { | |
| 11 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (x) { |
| 12 | 1 | os << x.get(); | |
| 13 | } | ||
| 14 | 2 | return os; | |
| 15 | } | ||
| 16 | |||
| 17 | ✗ | std::ostream& operator<<(std::ostream& os, const boost::optional<unsigned>& x) { | |
| 18 | ✗ | if (x) { | |
| 19 | ✗ | os << x.get(); | |
| 20 | } | ||
| 21 | ✗ | return os; | |
| 22 | } | ||
| 23 | |||
| 24 | 2 | std::ostream& operator<<(std::ostream& os, const boost::optional<int>& x) { | |
| 25 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (x) { |
| 26 | 1 | os << x.get(); | |
| 27 | } | ||
| 28 | 2 | return os; | |
| 29 | } | ||
| 30 | |||
| 31 | 9212156 | std::ostream& operator<<(std::ostream& os, const boost::optional<std::string>& x) { | |
| 32 |
2/2✓ Branch 0 taken 9212155 times.
✓ Branch 1 taken 1 time.
|
9212156 | if (x) { |
| 33 | 9212155 | os << x.get(); | |
| 34 | } | ||
| 35 | 9212156 | return os; | |
| 36 | } | ||
| 37 | |||
| 38 | } // namespace openstudio | ||
| 39 |