Skip to content

Commit

Permalink
split types from type traits
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Mar 16, 2024
1 parent 2bbbb52 commit bfd510b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/flatmemory/details/byte_buffer_segmented.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cassert>
#include <cstddef>
Expand Down
4 changes: 0 additions & 4 deletions include/flatmemory/details/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#ifndef FLATMEMORY_TYPE_TRAITS_HPP_
#define FLATMEMORY_TYPE_TRAITS_HPP_

#include "flatmemory/details/layout.hpp"

#include <concepts>
#include <cstddef>
#include <type_traits>
Expand All @@ -41,8 +39,6 @@ concept IsTriviallyCopyable = std::is_trivially_copyable_v<T>;

template<typename T>
concept IsTriviallyCopyableOrCustom = (IsTriviallyCopyable<T> || IsCustom<T>);

using NumBytes = size_t;
}

#endif
30 changes: 30 additions & 0 deletions include/flatmemory/details/types.hpp
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#ifndef FLATMEMORY_TYPES_HPP_
#define FLATMEMORY_TYPES_HPP_

#include <concepts>
#include <cstddef>

namespace flatmemory
{

using NumBytes = size_t;
}

#endif
2 changes: 1 addition & 1 deletion include/flatmemory/details/types/bitset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
#include <bit>
Expand Down
4 changes: 2 additions & 2 deletions include/flatmemory/details/types/trivial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#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"
Expand Down
2 changes: 1 addition & 1 deletion src/details/algorithms/murmurhash3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <flatmemory/details/algorithms/murmurhash3.hpp>
#include "flatmemory/details/algorithms/murmurhash3.hpp"

//-----------------------------------------------------------------------------

Expand Down

0 comments on commit bfd510b

Please sign in to comment.