clang-format

This commit is contained in:
Guillaume Meunier
2024-03-30 17:00:34 +01:00
parent bb660cfb3f
commit 9cceaac648
122 changed files with 2904 additions and 2783 deletions
+4 -5
View File
@@ -19,18 +19,17 @@
#pragma once
#include <stdexcept>
#include <pthread.h>
#include <thread>
#include <utility>
#include <pthread.h>
namespace utils
{
template<typename... Args>
std::thread named_thread(const std::string& name, Args&&... args)
template <typename... Args>
std::thread named_thread(const std::string & name, Args &&... args)
{
std::thread t{std::forward<Args>(args)...};
pthread_setname_np(t.native_handle(), name.substr(0, 15).c_str());
return t;
}
}
} // namespace utils
-1
View File
@@ -56,7 +56,6 @@ public:
read_index.store(next_read);
return std::move(res);
}
};
} // namespace utils
+7 -6
View File
@@ -21,7 +21,7 @@
#include <cassert>
template<typename T>
template <typename T>
class singleton
{
// static_assert(std::derived_from<T, singleton<T>>);
@@ -32,7 +32,7 @@ protected:
singleton()
{
assert(instance_ == nullptr);
instance_ = reinterpret_cast<T*>(this);
instance_ = reinterpret_cast<T *>(this);
}
~singleton()
@@ -41,15 +41,16 @@ protected:
instance_ = nullptr;
}
singleton(const singleton&) = delete;
singleton& operator=(const singleton&) = delete;
singleton(const singleton &) = delete;
singleton & operator=(const singleton &) = delete;
public:
static T & instance()
{
assert(instance_ != nullptr);
return *reinterpret_cast<T*>(instance_);
return *reinterpret_cast<T *>(instance_);
}
};
template<typename T> T * singleton<T>::instance_;
template <typename T>
T * singleton<T>::instance_;
+2 -2
View File
@@ -57,13 +57,13 @@ public:
auto userdata_first()
{
using F = decltype(std::function(impl));
return details::add_void<F>::template fn_0<T>;
return ::details::add_void<F>::template fn_0<T>;
}
operator auto()
{
using F = decltype(std::function(impl));
return details::add_void<F>::template fn<T>;
return ::details::add_void<F>::template fn<T>;
}
operator void *()
+1 -1
View File
@@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <filesystem>
#include <cstdlib>
#include <filesystem>
std::filesystem::path xdg_config_home()
{