Run clang-format

This commit is contained in:
Isaac Marovitz 2023-07-06 17:16:25 +01:00
parent d999edfd2c
commit 1f05a8a6a6
125 changed files with 10664 additions and 7154 deletions

View file

@ -6,9 +6,9 @@
#include <utility>
namespace orbis {
//template <typename T, typename... Args> T *knew(Args &&...args);
// template <typename T, typename... Args> T *knew(Args &&...args);
inline namespace utils {
void kfree(void* ptr, std::size_t size);
void kfree(void *ptr, std::size_t size);
struct RcBase {
std::atomic<unsigned> references{0};
@ -50,24 +50,23 @@ public:
Ref() = default;
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref(OT *ref) : m_ref(ref) {
requires(std::is_base_of_v<T, OT>) Ref(OT *ref) : m_ref(ref) {
if (m_ref != nullptr) {
ref->incRef();
}
}
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref(const Ref<OT> &other) : m_ref(other.get()) {
requires(std::is_base_of_v<T, OT>) Ref(const Ref<OT> &other)
: m_ref(other.get()) {
if (m_ref != nullptr) {
m_ref->incRef();
}
}
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref(Ref<OT> &&other) : m_ref(other.release()) {}
requires(std::is_base_of_v<T, OT>) Ref(Ref<OT> &&other)
: m_ref(other.release()) {}
Ref(const Ref &other) : m_ref(other.get()) {
if (m_ref != nullptr) {
@ -77,22 +76,19 @@ public:
Ref(Ref &&other) : m_ref(other.release()) {}
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref &operator=(Ref<OT> &&other) {
requires(std::is_base_of_v<T, OT>) Ref &operator=(Ref<OT> &&other) {
other.swap(*this);
return *this;
}
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref &operator=(OT *other) {
requires(std::is_base_of_v<T, OT>) Ref &operator=(OT *other) {
*this = Ref(other);
return *this;
}
template <typename OT>
requires(std::is_base_of_v<T, OT>)
Ref &operator=(const Ref<OT> &other) {
requires(std::is_base_of_v<T, OT>) Ref &operator=(const Ref<OT> &other) {
*this = Ref(other);
return *this;
}