mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-09 23:22:33 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -24,19 +24,22 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
class Optional {
|
||||
public:
|
||||
constexpr Optional() : value_ { }, valid_ { false } { };
|
||||
constexpr Optional(const T& value) : value_ { value }, valid_ { true } { };
|
||||
constexpr Optional(T&& value) : value_ { std::move(value) }, valid_ { true } { };
|
||||
public:
|
||||
constexpr Optional()
|
||||
: value_{}, valid_{false} {};
|
||||
constexpr Optional(const T& value)
|
||||
: value_{value}, valid_{true} {};
|
||||
constexpr Optional(T&& value)
|
||||
: value_{std::move(value)}, valid_{true} {};
|
||||
|
||||
bool is_valid() const { return valid_; };
|
||||
T value() const { return value_; };
|
||||
bool is_valid() const { return valid_; };
|
||||
T value() const { return value_; };
|
||||
|
||||
private:
|
||||
T value_;
|
||||
bool valid_;
|
||||
private:
|
||||
T value_;
|
||||
bool valid_;
|
||||
};
|
||||
|
||||
#endif/*__OPTIONAL_H__*/
|
||||
#endif /*__OPTIONAL_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue