From 71befa7685a9209d713be6eddaa9a696170d526d Mon Sep 17 00:00:00 2001 From: vil02 Date: Sat, 27 Jan 2024 21:04:34 +0100 Subject: [PATCH] style: `constexpr` functions are `inline` --- api/any.hpp | 6 +++--- api/array.hpp | 16 ++++++++-------- api/fn.hpp | 10 +++++----- api/map.hpp | 18 +++++++++--------- api/misc.hpp | 4 ++-- api/slice.hpp | 18 +++++++++--------- api/str.hpp | 18 +++++++++--------- api/trait.hpp | 8 ++++---- 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/api/any.hpp b/api/any.hpp index 73862002c..558a404dd 100644 --- a/api/any.hpp +++ b/api/any.hpp @@ -251,7 +251,7 @@ namespace jule } template - inline constexpr jule::Bool operator!=(const T &expr) const + constexpr jule::Bool operator!=(const T &expr) const { return !this->operator==(expr); } @@ -279,12 +279,12 @@ namespace jule return !this->operator==(other); } - inline constexpr jule::Bool operator==(std::nullptr_t) const noexcept + constexpr jule::Bool operator==(std::nullptr_t) const noexcept { return !this->data; } - inline constexpr jule::Bool operator!=(std::nullptr_t) const noexcept + constexpr jule::Bool operator!=(std::nullptr_t) const noexcept { return !this->operator==(nullptr); } diff --git a/api/array.hpp b/api/array.hpp index db05993e2..5474d736e 100644 --- a/api/array.hpp +++ b/api/array.hpp @@ -48,22 +48,22 @@ namespace jule typedef Item *Iterator; typedef const Item *ConstIterator; - inline constexpr Iterator begin(void) noexcept + constexpr Iterator begin(void) noexcept { return this->buffer; } - inline constexpr ConstIterator begin(void) const noexcept + constexpr ConstIterator begin(void) const noexcept { return this->buffer; } - inline constexpr Iterator end(void) noexcept + constexpr Iterator end(void) noexcept { return this->begin() + N; } - inline constexpr ConstIterator end(void) const noexcept + constexpr ConstIterator end(void) const noexcept { return this->begin() + N; } @@ -132,12 +132,12 @@ namespace jule 0, N); } - inline constexpr jule::Int len(void) const noexcept + constexpr jule::Int len(void) const noexcept { return N; } - inline constexpr jule::Bool empty(void) const noexcept + constexpr jule::Bool empty(void) const noexcept { return N == 0; } @@ -157,14 +157,14 @@ namespace jule return true; } - inline constexpr jule::Bool operator!=(const jule::Array &src) const + constexpr jule::Bool operator!=(const jule::Array &src) const { return !this->operator==(src); } // Returns element by index. // Not includes safety checking. - inline constexpr Item &__at(const jule::Int &index) const noexcept + constexpr Item &__at(const jule::Int &index) const noexcept { return this->buffer[index]; } diff --git a/api/fn.hpp b/api/fn.hpp index 934465a95..f56c313f1 100644 --- a/api/fn.hpp +++ b/api/fn.hpp @@ -84,7 +84,7 @@ namespace jule #endif } - inline constexpr jule::Uintptr addr(void) const noexcept + constexpr jule::Uintptr addr(void) const noexcept { return this->_addr; } @@ -104,22 +104,22 @@ namespace jule this->buffer = function; } - inline constexpr jule::Bool operator==(const Fn &fn) const noexcept + constexpr jule::Bool operator==(const Fn &fn) const noexcept { return this->addr() == fn.addr(); } - inline constexpr jule::Bool operator!=(const Fn &fn) const noexcept + constexpr jule::Bool operator!=(const Fn &fn) const noexcept { return !this->operator==(fn); } - inline constexpr jule::Bool operator==(std::nullptr_t) const noexcept + constexpr jule::Bool operator==(std::nullptr_t) const noexcept { return this->buffer == nullptr; } - inline constexpr jule::Bool operator!=(std::nullptr_t) const noexcept + constexpr jule::Bool operator!=(std::nullptr_t) const noexcept { return !this->operator==(nullptr); } diff --git a/api/map.hpp b/api/map.hpp index 2b3612692..de5a9118a 100644 --- a/api/map.hpp +++ b/api/map.hpp @@ -55,27 +55,27 @@ namespace jule this->buffer.insert(pair); } - inline constexpr auto begin(void) noexcept + constexpr auto begin(void) noexcept { return this->buffer.begin(); } - inline constexpr auto begin(void) const noexcept + constexpr auto begin(void) const noexcept { return this->buffer.begin(); } - inline constexpr auto end(void) noexcept + constexpr auto end(void) noexcept { return this->buffer.end(); } - inline constexpr auto end(void) const noexcept + constexpr auto end(void) const noexcept { return this->buffer.end(); } - inline constexpr void clear(void) noexcept + constexpr void clear(void) noexcept { this->buffer.clear(); } @@ -98,12 +98,12 @@ namespace jule return keys; } - inline constexpr jule::Bool has(const Key &key) const + constexpr jule::Bool has(const Key &key) const { return this->buffer.find(key) != this->end(); } - inline constexpr jule::Int len(void) const noexcept + constexpr jule::Int len(void) const noexcept { return this->buffer.size(); } @@ -113,12 +113,12 @@ namespace jule this->buffer.erase(key); } - inline constexpr jule::Bool operator==(const std::nullptr_t) const noexcept + constexpr jule::Bool operator==(const std::nullptr_t) const noexcept { return this->buffer.empty(); } - inline constexpr jule::Bool operator!=(const std::nullptr_t) const noexcept + constexpr jule::Bool operator!=(const std::nullptr_t) const noexcept { return !this->operator==(nullptr); } diff --git a/api/misc.hpp b/api/misc.hpp index 9b24c09a2..cd92718ec 100644 --- a/api/misc.hpp +++ b/api/misc.hpp @@ -65,7 +65,7 @@ namespace jule } template - inline constexpr auto unsafe_div( + constexpr auto unsafe_div( #ifndef __JULE_ENABLE__PRODUCTION const char *file, #endif @@ -75,7 +75,7 @@ namespace jule } template - inline constexpr auto unsafe_mod( + constexpr auto unsafe_mod( #ifndef __JULE_ENABLE__PRODUCTION const char *file, #endif diff --git a/api/slice.hpp b/api/slice.hpp index da1ef4e66..649cecf52 100644 --- a/api/slice.hpp +++ b/api/slice.hpp @@ -213,22 +213,22 @@ namespace jule typedef Item *Iterator; typedef const Item *ConstIterator; - inline constexpr Iterator begin(void) noexcept + constexpr Iterator begin(void) noexcept { return this->_slice; } - inline constexpr ConstIterator begin(void) const noexcept + constexpr ConstIterator begin(void) const noexcept { return this->_slice; } - inline constexpr Iterator end(void) noexcept + constexpr Iterator end(void) noexcept { return this->_slice + this->_len; } - inline constexpr ConstIterator end(void) const noexcept + constexpr ConstIterator end(void) const noexcept { return this->_slice + this->_len; } @@ -296,12 +296,12 @@ namespace jule this->len()); } - inline constexpr jule::Int len(void) const noexcept + constexpr jule::Int len(void) const noexcept { return this->_len; } - inline constexpr jule::Int cap(void) const noexcept + constexpr jule::Int cap(void) const noexcept { return this->_cap; } @@ -348,17 +348,17 @@ namespace jule return true; } - inline constexpr jule::Bool operator!=(const jule::Slice &src) const + constexpr jule::Bool operator!=(const jule::Slice &src) const { return !this->operator==(src); } - inline constexpr jule::Bool operator==(const std::nullptr_t) const noexcept + constexpr jule::Bool operator==(const std::nullptr_t) const noexcept { return !this->_slice; } - inline constexpr jule::Bool operator!=(const std::nullptr_t) const noexcept + constexpr jule::Bool operator!=(const std::nullptr_t) const noexcept { return !this->operator==(nullptr); } diff --git a/api/str.hpp b/api/str.hpp index 590df040e..1ca10267c 100644 --- a/api/str.hpp +++ b/api/str.hpp @@ -63,22 +63,22 @@ namespace jule typedef jule::U8 *Iterator; typedef const jule::U8 *ConstIterator; - inline constexpr Iterator begin(void) noexcept + constexpr Iterator begin(void) noexcept { return static_cast(&this->buffer[0]); } - inline constexpr ConstIterator begin(void) const noexcept + constexpr ConstIterator begin(void) const noexcept { return static_cast(&this->buffer[0]); } - inline constexpr Iterator end(void) noexcept + constexpr Iterator end(void) noexcept { return static_cast(&this->buffer[this->len()]); } - inline constexpr ConstIterator end(void) const noexcept + constexpr ConstIterator end(void) const noexcept { return static_cast(&this->buffer[this->len()]); } @@ -136,22 +136,22 @@ namespace jule 0, this->len()); } - inline constexpr jule::Int len(void) const noexcept + constexpr jule::Int len(void) const noexcept { return this->buffer.length(); } - inline constexpr jule::Bool empty(void) const noexcept + constexpr jule::Bool empty(void) const noexcept { return this->buffer.empty(); } - inline constexpr operator char *(void) const noexcept + constexpr operator char *(void) const noexcept { return const_cast(reinterpret_cast(this->buffer.c_str())); } - inline constexpr operator const char *(void) const noexcept + constexpr operator const char *(void) const noexcept { return reinterpret_cast(this->buffer.c_str()); } @@ -192,7 +192,7 @@ namespace jule // Returns element by index. // Not includes safety checking. - inline constexpr jule::U8 &__at(const jule::Int &index) noexcept + constexpr jule::U8 &__at(const jule::Int &index) noexcept { return this->buffer[index]; } diff --git a/api/trait.hpp b/api/trait.hpp index a6ae7a24c..70187803c 100644 --- a/api/trait.hpp +++ b/api/trait.hpp @@ -238,22 +238,22 @@ namespace jule this->__get_copy(src); } - inline constexpr jule::Bool operator==(const jule::Trait &src) const noexcept + constexpr jule::Bool operator==(const jule::Trait &src) const noexcept { return this->data.alloc == this->data.alloc; } - inline constexpr jule::Bool operator!=(const jule::Trait &src) const noexcept + constexpr jule::Bool operator!=(const jule::Trait &src) const noexcept { return !this->operator==(src); } - inline constexpr jule::Bool operator==(std::nullptr_t) const noexcept + constexpr jule::Bool operator==(std::nullptr_t) const noexcept { return this->data.alloc == nullptr; } - inline constexpr jule::Bool operator!=(std::nullptr_t) const noexcept + constexpr jule::Bool operator!=(std::nullptr_t) const noexcept { return !this->operator==(nullptr); }