Skip to content

Commit

Permalink
Clang format.
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode committed Nov 28, 2023
1 parent 2734914 commit 7e4df6c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion code/include/swoc/Errata.h
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,8 @@ Errata::assign(code_type code) -> self_type & {
return *this;
}

inline bool Errata::has_severity() const {
inline bool
Errata::has_severity() const {
return _data && _data->_severity.has_value();
}
inline auto
Expand Down
6 changes: 4 additions & 2 deletions code/include/swoc/TextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,13 @@ inline constexpr CharSet::CharSet(TextView const &chars) {
}
}

inline bool CharSet::operator()(unsigned char c) const {
inline bool
CharSet::operator()(unsigned char c) const {
return _chars[c];
}

inline bool CharSet::operator()(char c) const {
inline bool
CharSet::operator()(char c) const {
return _chars[uint8_t(c)];
}

Expand Down
14 changes: 5 additions & 9 deletions code/include/swoc/swoc_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ template <typename... Types> struct type_list {
template <typename T> struct let {
using self_type = let;

let(self_type const& that) = delete;
self_type & operator = (self_type const&) = delete;
let(self_type const &that) = delete;
self_type &operator=(self_type const &) = delete;

T &_var; ///< Reference to scoped variable.
T _value; ///< Original value.
Expand All @@ -280,19 +280,15 @@ template <typename T> struct let {
~let();
};

template <typename T> let<T>::let(T &var, T const &value) : _var(var), _value(std::move(var))
{
template <typename T> let<T>::let(T &var, T const &value) : _var(var), _value(std::move(var)) {
_var = value;
}
template <typename T> let<T>::let(T &var, T &&value) : _var(var), _value(std::move(var))
{
template <typename T> let<T>::let(T &var, T &&value) : _var(var), _value(std::move(var)) {
_var = std::move(value);
}

template <typename T> let<T>::~let()
{
template <typename T> let<T>::~let() {
_var = std::move(_value);
}


}}} // namespace swoc::SWOC_VERSION_NS::meta
2 changes: 1 addition & 1 deletion unit_tests/test_meta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TEST_CASE("Meta let", "[meta][let]") {
std::string s{"Evil Dave Rulz With An Iron Keyboard"}; // force allocation.
auto sptr = s.data();
{
char const * text = "Twas brillig and the slithy toves";
char const *text = "Twas brillig and the slithy toves";
let guard(s, std::string(text));
REQUIRE(s == text);
REQUIRE(s.data() != sptr);
Expand Down

0 comments on commit 7e4df6c

Please sign in to comment.