diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-04 15:07:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-04 15:39:43 +0100 |
commit | b0c87995cbe887d36c7aa5ecb6f5b0f3224eb595 (patch) | |
tree | 86ae804faf16195847c1d36eb800d58d0b027ef8 /compat/LooseQuadtree-impl.h | |
parent | 7dd0604d57fb0941b87cc944f46afa68e386d99f (diff) |
compat/lqt: make it build
Diffstat (limited to 'compat/LooseQuadtree-impl.h')
-rw-r--r-- | compat/LooseQuadtree-impl.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/compat/LooseQuadtree-impl.h b/compat/LooseQuadtree-impl.h index a8791a46..470377c8 100644 --- a/compat/LooseQuadtree-impl.h +++ b/compat/LooseQuadtree-impl.h @@ -2,9 +2,11 @@ #define LOOSEQUADTREE_LOOSEQUADTREE_IMPL_H #include "LooseQuadtree.h" +#include "compat/assert.hpp" +#undef assert +#define assert fm_assert #include <array> -#include <cassert> #include <cstddef> #include <deque> #include <forward_list> @@ -15,6 +17,15 @@ #include <type_traits> #include <vector> +#if defined __clang__ || defined __CLION_IDE__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" +#endif +#ifdef __GNUG__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + namespace loose_quadtree { namespace detail { @@ -25,9 +36,9 @@ namespace detail { class BlocksAllocator { public: - const static std::size_t kBlockAlign = alignof(long double); - const static std::size_t kBlockSize = 16384; - const static std::size_t kMaxAllowedAlloc = sizeof(void*) * 8; + static constexpr std::size_t kBlockAlign = alignof(long double); + static constexpr std::size_t kBlockSize = 16384; + static constexpr std::size_t kMaxAllowedAlloc = sizeof(void*) * 8; BlocksAllocator(); ~BlocksAllocator(); @@ -1480,14 +1491,14 @@ template <typename NumberT, typename ObjectT, typename BoundingBoxExtractorT> template <typename NumberT, typename ObjectT, typename BoundingBoxExtractorT> LooseQuadtree<NumberT, ObjectT, BoundingBoxExtractorT>::Query:: -Query(Query&& other) : pimpl_(other.pimpl_) { +Query(Query&& other) noexcept : pimpl_(other.pimpl_) { other.pimpl_ = nullptr; } template <typename NumberT, typename ObjectT, typename BoundingBoxExtractorT> auto LooseQuadtree<NumberT, ObjectT, BoundingBoxExtractorT>::Query:: -operator=(Query&& other) -> Query& { +operator=(Query&& other) noexcept -> Query& { this->~Query(); pimpl_ = other.pimpl_; other.pimpl_ = nullptr; @@ -1520,4 +1531,13 @@ Next() { } //loose_quadtree +#ifdef __GNUG__ +#pragma GCC diagnostic pop +#endif +#if defined __clang__ || defined __CLION_IDE__ +#pragma clang diagnostic pop +#endif + +#undef assert + #endif //LOOSEQUADTREE_LOOSEQUADTREE_IMPL_H |