diff --git a/CHANGELOG.md b/CHANGELOG.md
index 70cfd3e..9d31e58 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
- Fixed rvalue row corruption bug on MSVC ([info](https://developercommunity.visualstudio.com/t/C:-Corrupt-references-when-creating-a/10446877))
- Added `Cols...` selector template parameter to `at()`, `front()` and `back()`
+- Added `structs.mixins`
+- Added copy-based fallbacks for `unordered_erase()`, `insert()`, `emplace()` and `swap_columns()` (previously they required movability)
## v0.6.0
diff --git a/docs/pages/schema.md b/docs/pages/schema.md
index 8d614d2..144572b 100644
--- a/docs/pages/schema.md
+++ b/docs/pages/schema.md
@@ -1,8 +1,8 @@
-@page schema Config File Schema
+@page schema Config Schema
@tableofcontents
-This is the config file schema for the `*.toml` configuration files that are used with `soagen`, a command-line tool
+This is the schema for the `*.toml` configuration files that are used with `soagen`, a command-line tool
for generating SoA container classes for use in C++.
@see
@@ -404,7 +404,7 @@ This code will be at class scope.
@note You _could_ use this to inject functions, but writing C++ code in a toml config file isn't exactly the best
user-experience. If you must do this, best practice would be to only use it for very simple functions like one-liner
-conversion operators, et cetera.
+conversion operators, et cetera. A better strategy is to use CRTP (see @ref schema_structs_mixins).
@@ -421,6 +421,40 @@ This code will be at class scope.
+@subsection schema_structs_mixins mixins
+
+List of type names to use as CRTP 'mixin' base classes. Each named type must be a template class that takes one type argument
+(additional template arguments are allowed but must be defaulted).
+
+**Type:** string, or array of strings
+
+**Required:** No
+
+**Default:** None
+
+**Example:**
+
+```toml
+[structs.particles]
+mixins = 'foo::add_some_functionality'
+```
+
+Where `foo::add_some_functionality` is something like this:
+
+```cpp
+namespace foo
+{
+ template
+ struct add_some_functionality
+ {
+ // ...
+ };
+}
+
+```
+
+
+
@subsection schema_structs_movable movable
Used to disable the move constructor + assignment operator if necessary.
diff --git a/docs/poxy.toml b/docs/poxy.toml
index 3aeba24..2e20882 100644
--- a/docs/poxy.toml
+++ b/docs/poxy.toml
@@ -22,7 +22,7 @@ extra_files = [
'images/author.jpg',
]
stylesheets = ['pages.css']
-navbar = ['pages', 'namespaces', 'classes']
+navbar = ['schema', 'pages', 'namespaces', 'classes']
[warnings]
enabled = true
diff --git a/examples/entities.hpp b/examples/entities.hpp
index 9cfbb25..b3385dd 100644
--- a/examples/entities.hpp
+++ b/examples/entities.hpp
@@ -139,7 +139,25 @@ namespace soagen::detail
#define SOAGEN_NAME_pos
SOAGEN_MAKE_NAME(pos);
#endif
+}
+
+namespace soagen_struct_impl_soagen_examples_entities
+{
+ SOAGEN_DISABLE_WARNINGS;
+ using namespace soagen::examples;
+ SOAGEN_ENABLE_WARNINGS;
+
+ using soagen_table_traits_type = soagen::table_traits<
+ /* id */ soagen::column_traits,
+ /* name */ soagen::column_traits,
+ /* pos */ soagen::column_traits,
+ /* orient */ soagen::column_traits>;
+ using soagen_allocator_type = soagen::allocator;
+}
+
+namespace soagen::detail
+{
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::entities, 0, id);
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::entities, 1, name);
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::entities, 2, pos);
@@ -152,17 +170,13 @@ namespace soagen::detail
template <>
struct table_traits_type_
{
- using type = table_traits<
- /* id */ column_traits,
- /* name */ column_traits,
- /* pos */ column_traits,
- /* orient */ column_traits>;
+ using type = soagen_struct_impl_soagen_examples_entities::soagen_table_traits_type;
};
template <>
struct allocator_type_
{
- using type = soagen::allocator;
+ using type = soagen_struct_impl_soagen_examples_entities::soagen_allocator_type;
};
template <>
@@ -397,7 +411,7 @@ namespace soagen::examples
/// @availability This method is only available when all the column types are move-assignable.
SOAGEN_HIDDEN(template >)
SOAGEN_ALWAYS_INLINE
- SOAGEN_CPP20_CONSTEXPR
+ SOAGEN_CPP20_CONSTEXPR //
SOAGEN_ENABLE_IF_T(entities&, sfinae) erase(size_type pos) //
noexcept(soagen::has_nothrow_erase_member)
{
@@ -419,7 +433,7 @@ namespace soagen::examples
/// @availability This method is only available when all the column types are move-assignable.
SOAGEN_HIDDEN(template >)
SOAGEN_ALWAYS_INLINE
- SOAGEN_CPP20_CONSTEXPR
+ SOAGEN_CPP20_CONSTEXPR //
SOAGEN_ENABLE_IF_T(soagen::optional, sfinae) unordered_erase(size_type pos) //
noexcept(soagen::has_nothrow_unordered_erase_member)
{
@@ -551,7 +565,7 @@ namespace soagen::examples
column_traits<1>::param_type name = "",
column_traits<2>::param_type pos = {},
column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::push_back_is_nothrow)
+ noexcept(table_traits::push_back_is_nothrow) //
{
table_.emplace_back(static_cast::param_forward_type>(id),
static_cast::param_forward_type>(name),
@@ -561,14 +575,14 @@ namespace soagen::examples
}
/// @brief Adds a new row at the end of the table (rvalue overload).
- SOAGEN_HIDDEN(template )
+ SOAGEN_HIDDEN(template )
SOAGEN_CPP20_CONSTEXPR
entities& push_back(SOAGEN_ENABLE_IF_T(column_traits<0>::rvalue_type, sfinae) id,
column_traits<1>::rvalue_type name = "",
column_traits<2>::rvalue_type pos = {},
column_traits<3>::rvalue_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::rvalue_push_back_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct) //
+ noexcept(table_traits::rvalue_push_back_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct) //
{
table_.emplace_back(static_cast::rvalue_forward_type>(id),
static_cast::rvalue_forward_type>(name),
@@ -585,8 +599,8 @@ namespace soagen::examples
table_traits::row_constructible_from)>
SOAGEN_CPP20_CONSTEXPR
entities& emplace_back(Id&& id, Name&& name = "", Pos&& pos = {}, Orient&& orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::emplace_back_is_nothrow)
- SOAGEN_REQUIRES(table_traits::row_constructible_from) //
+ noexcept(table_traits::emplace_back_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::row_constructible_from) //
{
table_.emplace_back(static_cast(id),
static_cast(name),
@@ -596,12 +610,11 @@ namespace soagen::examples
}
/// @brief Constructs a new row directly in-place at the end of the table by unpacking a tuple-like object.
- template && table_traits::row_constructible_from))>
+ template )>
SOAGEN_CPP20_CONSTEXPR
- entities& emplace_back(Tuple&& tuple_) //
- noexcept(table_traits::emplace_back_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::row_constructible_from) //
+ entities& emplace_back(Tuple&& tuple_) //
+ noexcept(table_traits::emplace_back_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::row_constructible_from) //
{
table_.emplace_back(static_cast(tuple_));
return *this;
@@ -616,17 +629,17 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(entities&, sfinae) insert(size_type index_,
column_traits<0>::param_type id,
column_traits<1>::param_type name = "",
column_traits<2>::param_type pos = {},
- column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_,
static_cast::param_forward_type>(id),
@@ -639,17 +652,17 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(iterator, sfinae) insert(iterator iter_,
column_traits<0>::param_type id,
column_traits<1>::param_type name = "",
column_traits<2>::param_type pos = {},
- column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::param_forward_type>(id),
@@ -662,17 +675,17 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(const_iterator, sfinae) insert(const_iterator iter_,
column_traits<0>::param_type id,
column_traits<1>::param_type name = "",
column_traits<2>::param_type pos = {},
- column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<3>::param_type orient = { 1, 0, 0, 0 }) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::param_forward_type>(id),
@@ -686,8 +699,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
entities& insert(SOAGEN_ENABLE_IF_T(size_type, sfinae) index_,
@@ -695,9 +708,9 @@ namespace soagen::examples
column_traits<1>::rvalue_type name = "",
column_traits<2>::rvalue_type pos = {},
column_traits<3>::rvalue_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_,
static_cast::rvalue_forward_type>(id),
@@ -711,8 +724,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
iterator insert(SOAGEN_ENABLE_IF_T(iterator, sfinae) iter_,
@@ -720,9 +733,9 @@ namespace soagen::examples
column_traits<1>::rvalue_type name = "",
column_traits<2>::rvalue_type pos = {},
column_traits<3>::rvalue_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::rvalue_forward_type>(id),
@@ -736,8 +749,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
const_iterator insert(SOAGEN_ENABLE_IF_T(const_iterator, sfinae) iter_,
@@ -745,9 +758,9 @@ namespace soagen::examples
column_traits<1>::rvalue_type name = "",
column_traits<2>::rvalue_type pos = {},
column_traits<3>::rvalue_type orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::rvalue_forward_type>(id),
@@ -764,17 +777,17 @@ namespace soagen::examples
typename Name = column_traits<1>::default_emplace_type,
typename Pos = column_traits<2>::default_emplace_type,
typename Orient = column_traits<3>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from))>
SOAGEN_CPP20_CONSTEXPR
entities& emplace(size_type index_,
Id&& id,
Name&& name = "",
Pos&& pos = {},
- Orient&& orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::emplace_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ Orient&& orient = { 1, 0, 0, 0 }) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(index_,
static_cast(id),
@@ -791,13 +804,13 @@ namespace soagen::examples
typename Name = column_traits<1>::default_emplace_type,
typename Pos = column_traits<2>::default_emplace_type,
typename Orient = column_traits<3>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from))>
SOAGEN_CPP20_CONSTEXPR
iterator emplace(iterator iter_, Id&& id, Name&& name = "", Pos&& pos = {}, Orient&& orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::emplace_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(static_cast(iter_),
static_cast(id),
@@ -814,17 +827,17 @@ namespace soagen::examples
typename Name = column_traits<1>::default_emplace_type,
typename Pos = column_traits<2>::default_emplace_type,
typename Orient = column_traits<3>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from))>
SOAGEN_CPP20_CONSTEXPR
const_iterator emplace(const_iterator iter_,
Id&& id,
Name&& name = "",
Pos&& pos = {},
- Orient&& orient = { 1, 0, 0, 0 }) //
- noexcept(table_traits::emplace_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ Orient&& orient = { 1, 0, 0, 0 }) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(static_cast(iter_),
static_cast(id),
@@ -837,14 +850,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- entities& emplace(size_type index_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable&& table_traits::row_constructible_from) //
+ entities& emplace(size_type index_, Tuple&& tuple_) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(
+ table_traits::row_constructible_from&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_, static_cast(tuple_));
return *this;
@@ -853,14 +867,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- iterator emplace(iterator iter_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable&& table_traits::row_constructible_from) //
+ iterator emplace(iterator iter_, Tuple&& tuple_) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(
+ table_traits::row_constructible_from&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_), static_cast(tuple_));
return iter_;
@@ -869,15 +884,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- const_iterator emplace(const_iterator iter_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow)
- SOAGEN_REQUIRES(table_traits::row_constructible_from&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ const_iterator emplace(const_iterator iter_, Tuple&& tuple_) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(
+ table_traits::row_constructible_from&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_), static_cast(tuple_));
return iter_;
diff --git a/examples/shapes.hpp b/examples/shapes.hpp
index 38cd115..10d9f2e 100644
--- a/examples/shapes.hpp
+++ b/examples/shapes.hpp
@@ -159,7 +159,43 @@ namespace soagen::detail
#define SOAGEN_NAME_radius
SOAGEN_MAKE_NAME(radius);
#endif
+}
+
+namespace soagen_struct_impl_soagen_examples_boxes
+{
+ SOAGEN_DISABLE_WARNINGS;
+ using namespace soagen::examples;
+ SOAGEN_ENABLE_WARNINGS;
+
+ using soagen_table_traits_type = soagen::table_traits<
+ /* center_x */ soagen::column_traits,
+ /* center_y */ soagen::column_traits,
+ /* center_z */ soagen::column_traits,
+ /* extents_x */ soagen::column_traits,
+ /* extents_y */ soagen::column_traits,
+ /* extents_z */ soagen::column_traits,
+ /* mass */ soagen::column_traits>;
+
+ using soagen_allocator_type = soagen::allocator;
+}
+namespace soagen_struct_impl_soagen_examples_spheres
+{
+ SOAGEN_DISABLE_WARNINGS;
+ using namespace soagen::examples;
+ SOAGEN_ENABLE_WARNINGS;
+
+ using soagen_table_traits_type = soagen::table_traits<
+ /* center_x */ soagen::column_traits,
+ /* center_y */ soagen::column_traits,
+ /* center_z */ soagen::column_traits,
+ /* radius */ soagen::column_traits,
+ /* mass */ soagen::column_traits>;
+
+ using soagen_allocator_type = soagen::allocator;
+}
+namespace soagen::detail
+{
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::boxes, 0, center_x);
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::boxes, 1, center_y);
SOAGEN_MAKE_NAMED_COLUMN(soagen::examples::boxes, 2, center_z);
@@ -175,20 +211,13 @@ namespace soagen::detail
template <>
struct table_traits_type_
{
- using type = table_traits<
- /* center_x */ column_traits,
- /* center_y */ column_traits,
- /* center_z */ column_traits,
- /* extents_x */ column_traits,
- /* extents_y */ column_traits,
- /* extents_z */ column_traits,
- /* mass */ column_traits>;
+ using type = soagen_struct_impl_soagen_examples_boxes::soagen_table_traits_type;
};
template <>
struct allocator_type_
{
- using type = soagen::allocator;
+ using type = soagen_struct_impl_soagen_examples_boxes::soagen_allocator_type;
};
template <>
@@ -210,18 +239,13 @@ namespace soagen::detail
template <>
struct table_traits_type_
{
- using type = table_traits<
- /* center_x */ column_traits,
- /* center_y */ column_traits,
- /* center_z */ column_traits,
- /* radius */ column_traits,
- /* mass */ column_traits>;
+ using type = soagen_struct_impl_soagen_examples_spheres::soagen_table_traits_type;
};
template <>
struct allocator_type_
{
- using type = soagen::allocator;
+ using type = soagen_struct_impl_soagen_examples_spheres::soagen_allocator_type;
};
template <>
@@ -474,7 +498,7 @@ namespace soagen::examples
/// @availability This method is only available when all the column types are move-assignable.
SOAGEN_HIDDEN(template >)
SOAGEN_ALWAYS_INLINE
- SOAGEN_CPP20_CONSTEXPR
+ SOAGEN_CPP20_CONSTEXPR //
SOAGEN_ENABLE_IF_T(boxes&, sfinae) erase(size_type pos) //
noexcept(soagen::has_nothrow_erase_member)
{
@@ -496,7 +520,7 @@ namespace soagen::examples
/// @availability This method is only available when all the column types are move-assignable.
SOAGEN_HIDDEN(template >)
SOAGEN_ALWAYS_INLINE
- SOAGEN_CPP20_CONSTEXPR
+ SOAGEN_CPP20_CONSTEXPR //
SOAGEN_ENABLE_IF_T(soagen::optional, sfinae) unordered_erase(size_type pos) //
noexcept(soagen::has_nothrow_unordered_erase_member)
{
@@ -631,7 +655,7 @@ namespace soagen::examples
column_traits<4>::param_type extents_y = 0.5,
column_traits<5>::param_type extents_z = 0.5,
column_traits<6>::param_type mass = default_mass) //
- noexcept(table_traits::push_back_is_nothrow)
+ noexcept(table_traits::push_back_is_nothrow) //
{
table_.emplace_back(static_cast::param_forward_type>(center_x),
static_cast::param_forward_type>(center_y),
@@ -644,7 +668,7 @@ namespace soagen::examples
}
/// @brief Adds a new row at the end of the table (rvalue overload).
- SOAGEN_HIDDEN(template )
+ SOAGEN_HIDDEN(template )
SOAGEN_CPP20_CONSTEXPR
boxes& push_back(SOAGEN_ENABLE_IF_T(column_traits<0>::rvalue_type, sfinae) center_x,
column_traits<1>::rvalue_type center_y,
@@ -653,8 +677,8 @@ namespace soagen::examples
column_traits<4>::rvalue_type extents_y = 0.5,
column_traits<5>::rvalue_type extents_z = 0.5,
column_traits<6>::rvalue_type mass = default_mass) //
- noexcept(table_traits::rvalue_push_back_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct) //
+ noexcept(table_traits::rvalue_push_back_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct) //
{
table_.emplace_back(static_cast::rvalue_forward_type>(center_x),
static_cast::rvalue_forward_type>(center_y),
@@ -689,21 +713,21 @@ namespace soagen::examples
ExtentsY&& extents_y = 0.5,
ExtentsZ&& extents_z = 0.5,
Mass&& mass = default_mass) //
- noexcept(table_traits::emplace_back_is_nothrow)
- SOAGEN_REQUIRES(table_traits::row_constructible_from) //
+ Mass&&>) //
+ SOAGEN_REQUIRES(table_traits::row_constructible_from) //
{
table_.emplace_back(static_cast(center_x),
static_cast(center_y),
@@ -716,12 +740,11 @@ namespace soagen::examples
}
/// @brief Constructs a new row directly in-place at the end of the table by unpacking a tuple-like object.
- template && table_traits::row_constructible_from))>
+ template )>
SOAGEN_CPP20_CONSTEXPR
- boxes& emplace_back(Tuple&& tuple_) //
- noexcept(table_traits::emplace_back_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::row_constructible_from) //
+ boxes& emplace_back(Tuple&& tuple_) //
+ noexcept(table_traits::emplace_back_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::row_constructible_from) //
{
table_.emplace_back(static_cast(tuple_));
return *this;
@@ -736,8 +759,8 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(boxes&, sfinae) insert(size_type index_,
@@ -747,9 +770,9 @@ namespace soagen::examples
column_traits<3>::param_type extents_x = 0.5,
column_traits<4>::param_type extents_y = 0.5,
column_traits<5>::param_type extents_z = 0.5,
- column_traits<6>::param_type mass = default_mass) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<6>::param_type mass = default_mass) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_,
static_cast::param_forward_type>(center_x),
@@ -765,8 +788,8 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(iterator, sfinae) insert(iterator iter_,
@@ -776,9 +799,9 @@ namespace soagen::examples
column_traits<3>::param_type extents_x = 0.5,
column_traits<4>::param_type extents_y = 0.5,
column_traits<5>::param_type extents_z = 0.5,
- column_traits<6>::param_type mass = default_mass) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<6>::param_type mass = default_mass) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::param_forward_type>(center_x),
@@ -794,8 +817,8 @@ namespace soagen::examples
/// @brief Inserts a new row at an arbitrary position in the table.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- SOAGEN_HIDDEN(
- template
+ SOAGEN_HIDDEN(template
)
SOAGEN_CPP20_CONSTEXPR
SOAGEN_ENABLE_IF_T(const_iterator, sfinae) insert(const_iterator iter_,
@@ -805,9 +828,9 @@ namespace soagen::examples
column_traits<3>::param_type extents_x = 0.5,
column_traits<4>::param_type extents_y = 0.5,
column_traits<5>::param_type extents_z = 0.5,
- column_traits<6>::param_type mass = default_mass) //
- noexcept(table_traits::insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable) //
+ column_traits<6>::param_type mass = default_mass) //
+ noexcept(table_traits::insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::param_forward_type>(center_x),
@@ -824,8 +847,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
boxes& insert(SOAGEN_ENABLE_IF_T(size_type, sfinae) index_,
@@ -836,9 +859,9 @@ namespace soagen::examples
column_traits<4>::rvalue_type extents_y = 0.5,
column_traits<5>::rvalue_type extents_z = 0.5,
column_traits<6>::rvalue_type mass = default_mass) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_,
static_cast::rvalue_forward_type>(center_x),
@@ -855,8 +878,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
iterator insert(SOAGEN_ENABLE_IF_T(iterator, sfinae) iter_,
@@ -867,9 +890,9 @@ namespace soagen::examples
column_traits<4>::rvalue_type extents_y = 0.5,
column_traits<5>::rvalue_type extents_z = 0.5,
column_traits<6>::rvalue_type mass = default_mass) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::rvalue_forward_type>(center_x),
@@ -886,8 +909,8 @@ namespace soagen::examples
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
SOAGEN_HIDDEN(
- template
+ template
)
SOAGEN_CPP20_CONSTEXPR
const_iterator insert(SOAGEN_ENABLE_IF_T(const_iterator, sfinae) iter_,
@@ -898,9 +921,9 @@ namespace soagen::examples
column_traits<4>::rvalue_type extents_y = 0.5,
column_traits<5>::rvalue_type extents_z = 0.5,
column_traits<6>::rvalue_type mass = default_mass) //
- noexcept(table_traits::rvalue_insert_is_nothrow)
- SOAGEN_REQUIRES(table_traits::rvalue_type_list_is_distinct&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable) //
+ noexcept(table_traits::rvalue_insert_is_nothrow) //
+ SOAGEN_REQUIRES(table_traits::rvalues_are_distinct&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_),
static_cast::rvalue_forward_type>(center_x),
@@ -923,7 +946,7 @@ namespace soagen::examples
typename ExtentsY = column_traits<4>::default_emplace_type,
typename ExtentsZ = column_traits<5>::default_emplace_type,
typename Mass = column_traits<6>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ Mass&&>) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(index_,
static_cast(center_x),
@@ -978,7 +1001,7 @@ namespace soagen::examples
typename ExtentsY = column_traits<4>::default_emplace_type,
typename ExtentsZ = column_traits<5>::default_emplace_type,
typename Mass = column_traits<6>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ Mass&&>) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(static_cast(iter_),
static_cast(center_x),
@@ -1033,7 +1056,7 @@ namespace soagen::examples
typename ExtentsY = column_traits<4>::default_emplace_type,
typename ExtentsZ = column_traits<5>::default_emplace_type,
typename Mass = column_traits<6>::default_emplace_type SOAGEN_ENABLE_IF(
- (table_traits::all_move_constructible && table_traits::all_move_assignable
+ (table_traits::all_move_or_copy_constructible && table_traits::all_move_or_copy_assignable
&& table_traits::row_constructible_from)
- SOAGEN_REQUIRES(table_traits::all_move_constructible&& table_traits::all_move_assignable&&
- table_traits::row_constructible_from) //
+ Mass&&>) //
+ SOAGEN_REQUIRES(table_traits::all_move_or_copy_constructible&& table_traits::all_move_or_copy_assignable&&
+ table_traits::row_constructible_from) //
{
table_.emplace(static_cast(iter_),
static_cast(center_x),
@@ -1081,14 +1104,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- boxes& emplace(size_type index_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable&& table_traits::row_constructible_from) //
+ boxes& emplace(size_type index_, Tuple&& tuple_) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(
+ table_traits::row_constructible_from&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(index_, static_cast(tuple_));
return *this;
@@ -1097,14 +1121,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- iterator emplace(iterator iter_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow) SOAGEN_REQUIRES(
- table_traits::row_constructible_from&& table_traits::all_move_constructible&&
- table_traits::all_move_assignable&& table_traits::row_constructible_from) //
+ iterator emplace(iterator iter_, Tuple&& tuple_) //
+ noexcept(table_traits::emplace_is_nothrow) //
+ SOAGEN_REQUIRES(
+ table_traits::row_constructible_from&& table_traits::all_move_or_copy_constructible&&
+ table_traits::all_move_or_copy_assignable) //
{
table_.emplace(static_cast(iter_), static_cast(tuple_));
return iter_;
@@ -1113,15 +1138,15 @@ namespace soagen::examples
/// @brief Constructs a new row directly in-place at an arbitrary position in the table by unpacking a tuple-like object.
///
/// @availability This overload is only available when all the column types are move-constructible and move-assignable.
- template && table_traits::all_move_constructible
- && table_traits::all_move_assignable && table_traits::row_constructible_from))>
+ template
+ && table_traits::all_move_or_copy_constructible
+ && table_traits::all_move_or_copy_assignable))>
SOAGEN_CPP20_CONSTEXPR
- const_iterator emplace(const_iterator iter_, Tuple&& tuple_) //
- noexcept(table_traits::emplace_is_nothrow