Skip to content

Commit 6b10cfd

Browse files
committed
Revert some edits to fix GCC build
1 parent 61fa0ae commit 6b10cfd

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed

include/child.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,40 +73,40 @@ class Child {
7373

7474
// TODO: Look in to making these references instead of pointer returns
7575
/** @brief Get the Child's parent. */
76-
constexpr Child *get_parent() noexcept { return parent; }
77-
constexpr const Child *get_parent() const noexcept {
76+
Child *get_parent() noexcept { return parent; }
77+
const Child *get_parent() const noexcept {
7878
return const_cast<Child *>(parent);
7979
}
8080

8181
template <class C>
82-
constexpr C get_parent_as() noexcept {
82+
C get_parent_as() noexcept {
8383
return static_cast<C>(get_parent());
8484
}
8585

8686
/** @brief Set the Child's parent */
87-
constexpr void set_parent(Child *parent) noexcept { this->parent = parent; }
88-
constexpr void set_parent(const Child *parent) noexcept {
87+
void set_parent(Child *parent) noexcept { this->parent = parent; }
88+
void set_parent(const Child *parent) noexcept {
8989
this->parent = const_cast<Child *>(parent);
9090
}
9191

9292
/*--------- Formatter helper functions -----------*/
9393
// Check to see if the tree has a printer
94-
constexpr const bool has_formatter() noexcept;
94+
const bool has_formatter() noexcept;
9595

9696
// Get the printer from the tree
97-
constexpr Formatters::BaseFormatter &get_formatter() noexcept;
97+
Formatters::BaseFormatter &get_formatter() noexcept;
9898

99-
constexpr void set_printer(const Formatters::BaseFormatter &formatter) {
99+
void set_printer(const Formatters::BaseFormatter &formatter) {
100100
this->formatter = &const_cast<Formatters::BaseFormatter &>(formatter);
101101
}
102102

103103
/*--------- Primary member functions -------------*/
104104

105105
/** @brief Get the status of the object (success/failure) */
106-
constexpr const bool get_status() noexcept { return this->status; }
107-
constexpr const bool get_status() const noexcept { return this->status; }
106+
const bool get_status() noexcept { return this->status; }
107+
const bool get_status() const noexcept { return this->status; }
108108

109-
constexpr void failed() noexcept; // Report failure to the object.
109+
void failed() noexcept; // Report failure to the object.
110110

111111
// Calculate the padding for printing this object
112112
std::string padding() noexcept;
@@ -120,7 +120,7 @@ class Child {
120120
* This is propogated up the parent/child tree, so that when a child object
121121
* fails, the parent object is immediately updated to reflect that as well.
122122
*/
123-
constexpr inline void Child::failed() noexcept {
123+
inline void Child::failed() noexcept {
124124
this->status = false;
125125
// propogates the failure up the tree
126126
if (has_parent()) this->get_parent()->failed();
@@ -134,13 +134,13 @@ inline std::string Child::padding() noexcept {
134134
return has_parent() ? get_parent()->padding() + " " : "";
135135
}
136136

137-
constexpr inline const bool Child::has_formatter() noexcept {
137+
inline const bool Child::has_formatter() noexcept {
138138
if (this->formatter != nullptr) return true;
139139
if (!this->has_parent()) return false; // base case;
140140
return parent->has_formatter();
141141
}
142142

143-
constexpr inline Formatters::BaseFormatter &Child::get_formatter() noexcept {
143+
inline Formatters::BaseFormatter &Child::get_formatter() noexcept {
144144
if (this->formatter) return *formatter;
145145
if (!this->has_parent()) std::terminate();
146146
return parent->get_formatter();

include/let.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ class LetBase {
1313
bool delivered;
1414

1515
public:
16-
LetBase() noexcept : delivered(false) {}
16+
constexpr LetBase() noexcept : delivered(false) {}
1717
LetBase(const LetBase &copy) = default;
18-
constexpr void reset() noexcept { delivered = false; }
18+
void reset() noexcept { delivered = false; }
1919
constexpr const bool has_result() noexcept { return this->delivered; }
20-
constexpr const bool has_result() const noexcept { return this->delivered; }
2120
};
2221

2322
template <typename T>
@@ -37,9 +36,7 @@ class Let : public LetBase {
3736
return result.operator->();
3837
}
3938

40-
constexpr T &operator*() & { return value(); }
41-
constexpr const T &operator*() const & { return value(); }
42-
39+
T &operator*() & { return value(); }
4340
T &value()&;
4441
};
4542

include/result.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class Result {
2929
Result &operator=(Result &&) = default;
3030

3131
/*--------- Status helper functions --------------*/
32-
constexpr const bool get_status() noexcept { return value; }
33-
constexpr const bool get_status() const noexcept { return value; }
32+
const bool get_status() noexcept { return value; }
33+
const bool get_status() const noexcept { return value; }
3434

35-
constexpr operator bool() noexcept { return this->get_status(); }
36-
constexpr operator bool() const noexcept { return this->get_status(); }
35+
operator bool() noexcept { return this->get_status(); }
36+
operator bool() const noexcept { return this->get_status(); }
3737

3838
/*--------- Message helper functions -------------*/
3939
const std::string get_message() noexcept { return message; }

0 commit comments

Comments
 (0)