From bfd510bd8accbe4966b24cbd88d78807df428875 Mon Sep 17 00:00:00 2001 From: Dominik Drexler Date: Sat, 16 Mar 2024 13:00:53 +0100 Subject: [PATCH] split types from type traits --- .../details/byte_buffer_segmented.hpp | 2 +- include/flatmemory/details/type_traits.hpp | 4 --- include/flatmemory/details/types.hpp | 30 +++++++++++++++++++ include/flatmemory/details/types/bitset.hpp | 2 +- include/flatmemory/details/types/trivial.hpp | 4 +-- src/details/algorithms/murmurhash3.cpp | 2 +- 6 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 include/flatmemory/details/types.hpp diff --git a/include/flatmemory/details/byte_buffer_segmented.hpp b/include/flatmemory/details/byte_buffer_segmented.hpp index 8a5d6d1..f2ad9a7 100644 --- a/include/flatmemory/details/byte_buffer_segmented.hpp +++ b/include/flatmemory/details/byte_buffer_segmented.hpp @@ -18,7 +18,7 @@ #ifndef FLATMEMORY_BYTE_BUFFER_SEGMENTED_HPP_ #define FLATMEMORY_BYTE_BUFFER_SEGMENTED_HPP_ -#include "flatmemory/details/type_traits.hpp" +#include "flatmemory/details/types.hpp" #include #include diff --git a/include/flatmemory/details/type_traits.hpp b/include/flatmemory/details/type_traits.hpp index c20b72b..9531824 100644 --- a/include/flatmemory/details/type_traits.hpp +++ b/include/flatmemory/details/type_traits.hpp @@ -18,8 +18,6 @@ #ifndef FLATMEMORY_TYPE_TRAITS_HPP_ #define FLATMEMORY_TYPE_TRAITS_HPP_ -#include "flatmemory/details/layout.hpp" - #include #include #include @@ -41,8 +39,6 @@ concept IsTriviallyCopyable = std::is_trivially_copyable_v; template concept IsTriviallyCopyableOrCustom = (IsTriviallyCopyable || IsCustom); - -using NumBytes = size_t; } #endif diff --git a/include/flatmemory/details/types.hpp b/include/flatmemory/details/types.hpp new file mode 100644 index 0000000..17e4bb2 --- /dev/null +++ b/include/flatmemory/details/types.hpp @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2024 Dominik Drexler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef FLATMEMORY_TYPES_HPP_ +#define FLATMEMORY_TYPES_HPP_ + +#include +#include + +namespace flatmemory +{ + +using NumBytes = size_t; +} + +#endif diff --git a/include/flatmemory/details/types/bitset.hpp b/include/flatmemory/details/types/bitset.hpp index e4dcbe9..d48e6a7 100644 --- a/include/flatmemory/details/types/bitset.hpp +++ b/include/flatmemory/details/types/bitset.hpp @@ -26,9 +26,9 @@ #include "flatmemory/details/layout_utils.hpp" #include "flatmemory/details/operator.hpp" #include "flatmemory/details/type_traits.hpp" +#include "flatmemory/details/types/vector.hpp" #include "flatmemory/details/view.hpp" #include "flatmemory/details/view_const.hpp" -#include "vector.hpp" #include #include diff --git a/include/flatmemory/details/types/trivial.hpp b/include/flatmemory/details/types/trivial.hpp index 9263364..f8650e1 100644 --- a/include/flatmemory/details/types/trivial.hpp +++ b/include/flatmemory/details/types/trivial.hpp @@ -15,8 +15,8 @@ * along with this program. If not, see . */ -#ifndef FLATMEMORY_TYPES_STRUCT_HPP_ -#define FLATMEMORY_TYPES_STRUCT_HPP_ +#ifndef FLATMEMORY_TYPES_TRIVIAL_HPP_ +#define FLATMEMORY_TYPES_TRIVIAL_HPP_ #include "flatmemory/details/builder.hpp" #include "flatmemory/details/byte_buffer.hpp" diff --git a/src/details/algorithms/murmurhash3.cpp b/src/details/algorithms/murmurhash3.cpp index 8905284..29a79c9 100644 --- a/src/details/algorithms/murmurhash3.cpp +++ b/src/details/algorithms/murmurhash3.cpp @@ -7,7 +7,7 @@ // compile and run any of them on any platform, but your performance with the // non-native version will be less than optimal. -#include +#include "flatmemory/details/algorithms/murmurhash3.hpp" //-----------------------------------------------------------------------------