diff --git a/CHANGELOG.md b/CHANGELOG.md
index e78e0fe..e218051 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog
+## v0.5.0
+
+- Added rows to `soagen::table`
+- Added iterators to `soagen::table`
+- Added `soagen::table::for_each_column()`
+
## v0.4.0
- Fixed `soagen::is_table<>`
diff --git a/docs/pages/intro.md b/docs/pages/intro.md
index b1e3a16..bcf401f 100644
--- a/docs/pages/intro.md
+++ b/docs/pages/intro.md
@@ -243,6 +243,9 @@ I'd to present my solution to the problems of working with Structure-of-Arrays i
1. [`soagen`], a command-line code utility for generating bespoke `std::vector`-like SoA containers, and
2. [`soagen.hpp`], a single-header backing library upon which the generated code depends.
+@inline_success If you have no interest in using a command-line tool to generate SoA classes and instead want to
+build your own using [`soagen.hpp`] directly, skip to @ref intro_using_without_generator.
+
Typically you only need to use the command-line tool [`soagen`], and don't need to know anything about [`soagen.hpp`]
beyond "this needs to be on my include path somewhere" (since it's largely an implementation detail).
You may need to learn more about the backing library if you're doing more advanced stuff, but we'll cover that later.
@@ -254,10 +257,6 @@ version of the `entity` class [described above](#intro_motivation_soa_naive).
when it's the first word in a sentence, but I don't feel strongly about it. Render it however you like, I'm not fussed.
SoAgen, Soagen, SOAgen, whatever.
-@inline_success If you have no interest in using a command-line tool to generate SoA classes and instead want to
-build your own using [`soagen.hpp`] directly, skip to @ref intro_using_without_generator. The rest of the page is
-probably worth a read just for context, though.
-
@section intro_getting_started Getting started
@@ -294,7 +293,7 @@ usage: soagen [-h] [-v] [--version] [--install
] [--werror | --no-werror]
\__ \ (_) | (_| | (_| | __/ | | |
|___/\___/ \__,_|\__, |\___|_| |_|
__/ |
- |___/ v0.4.0 - marzer.github.io/soagen
+ |___/ v0.5.0 - marzer.github.io/soagen
Struct-of-Arrays generator for C++ projects.
@@ -367,7 +366,7 @@ Now run `soagen`:
> soagen src/*.toml
-soagen v0.4.0
+soagen v0.5.0
Reading src/entities.toml
Running clang-format for src/entities.hpp
Writing src/entities.hpp
@@ -408,7 +407,7 @@ too:
```plaintext
> soagen --install src
-soagen v0.4.0
+soagen v0.5.0
Copying soagen.hpp to src
All done!
```
@@ -1082,25 +1081,24 @@ default_constructible = 'auto' # let GENERATED_BODY create the default ctor
@section intro_using_without_generator Creating your own SoA types without the generator
What if you don't want to use a command-line tool to generate code, and instead want to build your own SoA
-types? That's totally fine! [`soagen.hpp`] was written with that use-case in mind.
-
-If you take a look at the source code for any `soagen`-generated table class you'll see that pretty much every function
-call is a one-liner pass-through to the common underlying container type #soagen::table. The generated classes buy you
-named members, default arguments to `push_back()` etc., and the ability to use rows and iterators, but most of those
-could be adapted to custom types relatively simply using the existing machinery. Crack open one of the generated `.hpp`
-files (e.g. [entities.hpp]) to see for yourself.
+types? That's totally fine! [`soagen.hpp`] was written with that use-case in mind. The generated classes buy you
+named members and default arguments to `push_back()` and friends, and are simply thin wrappers around the #soagen::table.
-To use a #soagen::table directly, you need to express it terms of #soagen::table_traits, which is itself expressed in terms of
-#soagen::column_traits. For example, to create a 'raw' verson of the entity table we've generated above:
+To use a #soagen::table directly, you need to express it terms of #soagen::table_traits,
+which is itself expressed in terms of the individual columns. For example, to create a 'raw' verson of the entity
+table we've generated above:
```cpp
-using entities = soagen::table,
- soagen::column_traits,
- soagen::column_traits,
- soagen::column_traits
->>;
+using entities = soagen::table<
+ soagen::table_traits<
+ unsigned,
+ std::string,
+ soagen::column_traits, // over-aligned
+ quaternion
+ >,
+ soagen::allocator
+>;
entities e;
diff --git a/examples/entities.hpp b/examples/entities.hpp
index 5528da1..5bfeda9 100644
--- a/examples/entities.hpp
+++ b/examples/entities.hpp
@@ -4,7 +4,7 @@
// See https://github.com/marzer/soagen/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
//----------------------------------------------------------------------------------------------------------------------
-// This file was generated by soagen v0.4.0 - do not modify it directly
+// This file was generated by soagen v0.5.0 - do not modify it directly
// https://marzer.github.io/soagen
//----------------------------------------------------------------------------------------------------------------------
#pragma once
@@ -15,15 +15,12 @@
/// @note The code and documentation in this file were generated by soagen - https://marzer.github.io/soagen
#include
-#if SOAGEN_VERSION_MAJOR != 0 || SOAGEN_VERSION_MINOR < 4
- #error soagen version mismatch - expected v0.4.X
+#if SOAGEN_VERSION_MAJOR != 0 || SOAGEN_VERSION_MINOR < 5
+ #error soagen version mismatch - expected v0.5.X
#endif
SOAGEN_DISABLE_WARNINGS;
#include
-#if SOAGEN_HAS_EXCEPTIONS
- #include
-#endif
SOAGEN_ENABLE_WARNINGS;
SOAGEN_PUSH_WARNINGS;
@@ -124,12 +121,6 @@ namespace soagen::examples
class entities;
}
-namespace soagen
-{
- template <>
- inline constexpr bool is_soa = true;
-}
-
namespace soagen::detail
{
#ifndef SOAGEN_NAME_id
@@ -168,6 +159,10 @@ namespace soagen::detail
using type = soagen::allocator;
};
+ template <>
+ struct is_soa_ : std::true_type
+ {};
+
SOAGEN_MAKE_COLUMN(soagen::examples::entities, 0, id);
SOAGEN_MAKE_COLUMN(soagen::examples::entities, 1, name);
SOAGEN_MAKE_COLUMN(soagen::examples::entities, 2, pos);
@@ -232,7 +227,7 @@ namespace soagen::examples
using table_traits = soagen::table_traits_type;
/// @brief The number of columns in the table.
- static constexpr size_type column_count = soagen::table_traits_type::column_count;
+ static constexpr size_type column_count = table_traits::column_count;
/// @brief Gets the soagen::column_traits for a specific column of the table.
template
@@ -243,19 +238,19 @@ namespace soagen::examples
using column_type = typename column_traits(Column)>::value_type;
/// @brief Row iterators returned by iterator functions.
- using iterator = soagen::iterator_type;
+ using iterator = soagen::iterator_type;
/// @brief Row iterators returned by const-qualified iterator functions.
- using const_iterator = soagen::iterator_type;
+ using const_iterator = soagen::iterator_type;
/// @brief Row iterators returned by rvalue-qualified iterator functions.
using rvalue_iterator = soagen::iterator_type;
/// @brief Regular (lvalue-qualified) row type used by this class.
- using row_type = soagen::row_type;
+ using row_type = soagen::row_type;
/// @brief Const row type used by this class.
- using const_row_type = soagen::row_type;
+ using const_row_type = soagen::row_type;
/// @brief Rvalue row type used by this class.
using rvalue_row_type = soagen::row_type;
@@ -508,7 +503,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return iterator{ *this, static_cast(*moved_pos) };
+ return iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -547,7 +542,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return const_iterator{ *this, static_cast(*moved_pos) };
+ return const_iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -568,10 +563,10 @@ namespace soagen::examples
SOAGEN_ALWAYS_INLINE
SOAGEN_CPP20_CONSTEXPR
entities& swap_columns() //
- noexcept(noexcept(
- std::declval().template swap_columns(A), static_cast(B)>()))
+ noexcept(noexcept(std::declval()
+ .template swap_columns(A), static_cast(B)>()))
{
- table_.template swap_columns(A), static_cast(B)>();
+ table_.template swap_columns(A), static_cast(B)>();
return *this;
}
@@ -1134,7 +1129,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) & noexcept
+ soagen::row_type row(size_type index) & noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -1246,7 +1241,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) const& noexcept
+ soagen::row_type row(size_type index) const& noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -1302,67 +1297,67 @@ namespace soagen::examples
/// @{
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() & noexcept
+ constexpr soagen::iterator_type begin() & noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() & noexcept
+ constexpr soagen::iterator_type end() & noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type begin() && noexcept
{
- return { std::move(*this), 0 };
+ return { std::move(table_), 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type end() && noexcept
{
- return { std::move(*this), static_cast(size()) };
+ return { std::move(table_), static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() const& noexcept
+ constexpr soagen::iterator_type begin() const& noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() const& noexcept
+ constexpr soagen::iterator_type end() const& noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cbegin() const& noexcept
+ constexpr soagen::iterator_type cbegin() const noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cend() const& noexcept
+ constexpr soagen::iterator_type cend() const noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @}
diff --git a/examples/entities.natvis b/examples/entities.natvis
index f0de668..e3be978 100644
--- a/examples/entities.natvis
+++ b/examples/entities.natvis
@@ -1,6 +1,6 @@
diff --git a/examples/shapes.hpp b/examples/shapes.hpp
index 8046353..803ad23 100644
--- a/examples/shapes.hpp
+++ b/examples/shapes.hpp
@@ -4,7 +4,7 @@
// See https://github.com/marzer/soagen/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
//----------------------------------------------------------------------------------------------------------------------
-// This file was generated by soagen v0.4.0 - do not modify it directly
+// This file was generated by soagen v0.5.0 - do not modify it directly
// https://marzer.github.io/soagen
//----------------------------------------------------------------------------------------------------------------------
#pragma once
@@ -15,14 +15,11 @@
/// @note The code and documentation in this file were generated by soagen - https://marzer.github.io/soagen
#include
-#if SOAGEN_VERSION_MAJOR != 0 || SOAGEN_VERSION_MINOR < 4
- #error soagen version mismatch - expected v0.4.X
+#if SOAGEN_VERSION_MAJOR != 0 || SOAGEN_VERSION_MINOR < 5
+ #error soagen version mismatch - expected v0.5.X
#endif
SOAGEN_DISABLE_WARNINGS;
-#if SOAGEN_HAS_EXCEPTIONS
- #include
-#endif
SOAGEN_ENABLE_WARNINGS;
SOAGEN_PUSH_WARNINGS;
@@ -124,15 +121,6 @@ namespace soagen::examples
class spheres;
}
-namespace soagen
-{
- template <>
- inline constexpr bool is_soa = true;
-
- template <>
- inline constexpr bool is_soa = true;
-}
-
namespace soagen::detail
{
#ifndef SOAGEN_NAME_center_x
@@ -194,6 +182,10 @@ namespace soagen::detail
using type = soagen::allocator;
};
+ template <>
+ struct is_soa_ : std::true_type
+ {};
+
SOAGEN_MAKE_COLUMN(soagen::examples::boxes, 0, center_x);
SOAGEN_MAKE_COLUMN(soagen::examples::boxes, 1, center_y);
SOAGEN_MAKE_COLUMN(soagen::examples::boxes, 2, center_z);
@@ -225,6 +217,10 @@ namespace soagen::detail
using type = soagen::allocator;
};
+ template <>
+ struct is_soa_ : std::true_type
+ {};
+
SOAGEN_MAKE_COLUMN(soagen::examples::spheres, 0, center_x);
SOAGEN_MAKE_COLUMN(soagen::examples::spheres, 1, center_y);
SOAGEN_MAKE_COLUMN(soagen::examples::spheres, 2, center_z);
@@ -304,7 +300,7 @@ namespace soagen::examples
using table_traits = soagen::table_traits_type;
/// @brief The number of columns in the table.
- static constexpr size_type column_count = soagen::table_traits_type::column_count;
+ static constexpr size_type column_count = table_traits::column_count;
/// @brief Gets the soagen::column_traits for a specific column of the table.
template
@@ -315,19 +311,19 @@ namespace soagen::examples
using column_type = typename column_traits(Column)>::value_type;
/// @brief Row iterators returned by iterator functions.
- using iterator = soagen::iterator_type;
+ using iterator = soagen::iterator_type;
/// @brief Row iterators returned by const-qualified iterator functions.
- using const_iterator = soagen::iterator_type;
+ using const_iterator = soagen::iterator_type;
/// @brief Row iterators returned by rvalue-qualified iterator functions.
using rvalue_iterator = soagen::iterator_type;
/// @brief Regular (lvalue-qualified) row type used by this class.
- using row_type = soagen::row_type;
+ using row_type = soagen::row_type;
/// @brief Const row type used by this class.
- using const_row_type = soagen::row_type;
+ using const_row_type = soagen::row_type;
/// @brief Rvalue row type used by this class.
using rvalue_row_type = soagen::row_type;
@@ -584,7 +580,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return iterator{ *this, static_cast(*moved_pos) };
+ return iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -623,7 +619,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return const_iterator{ *this, static_cast(*moved_pos) };
+ return const_iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -644,10 +640,10 @@ namespace soagen::examples
SOAGEN_ALWAYS_INLINE
SOAGEN_CPP20_CONSTEXPR
boxes& swap_columns() //
- noexcept(noexcept(
- std::declval().template swap_columns(A), static_cast(B)>()))
+ noexcept(noexcept(std::declval()
+ .template swap_columns(A), static_cast(B)>()))
{
- table_.template swap_columns(A), static_cast(B)>();
+ table_.template swap_columns(A), static_cast(B)>();
return *this;
}
@@ -1425,7 +1421,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) & noexcept
+ soagen::row_type row(size_type index) & noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -1537,7 +1533,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) const& noexcept
+ soagen::row_type row(size_type index) const& noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -1593,67 +1589,67 @@ namespace soagen::examples
/// @{
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() & noexcept
+ constexpr soagen::iterator_type begin() & noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() & noexcept
+ constexpr soagen::iterator_type end() & noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type begin() && noexcept
{
- return { std::move(*this), 0 };
+ return { std::move(table_), 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type end() && noexcept
{
- return { std::move(*this), static_cast(size()) };
+ return { std::move(table_), static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() const& noexcept
+ constexpr soagen::iterator_type begin() const& noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() const& noexcept
+ constexpr soagen::iterator_type end() const& noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cbegin() const& noexcept
+ constexpr soagen::iterator_type cbegin() const noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cend() const& noexcept
+ constexpr soagen::iterator_type cend() const noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @}
@@ -1725,7 +1721,7 @@ namespace soagen::examples
using table_traits = soagen::table_traits_type;
/// @brief The number of columns in the table.
- static constexpr size_type column_count = soagen::table_traits_type::column_count;
+ static constexpr size_type column_count = table_traits::column_count;
/// @brief Gets the soagen::column_traits for a specific column of the table.
template
@@ -1736,19 +1732,19 @@ namespace soagen::examples
using column_type = typename column_traits(Column)>::value_type;
/// @brief Row iterators returned by iterator functions.
- using iterator = soagen::iterator_type;
+ using iterator = soagen::iterator_type;
/// @brief Row iterators returned by const-qualified iterator functions.
- using const_iterator = soagen::iterator_type;
+ using const_iterator = soagen::iterator_type;
/// @brief Row iterators returned by rvalue-qualified iterator functions.
using rvalue_iterator = soagen::iterator_type;
/// @brief Regular (lvalue-qualified) row type used by this class.
- using row_type = soagen::row_type;
+ using row_type = soagen::row_type;
/// @brief Const row type used by this class.
- using const_row_type = soagen::row_type;
+ using const_row_type = soagen::row_type;
/// @brief Rvalue row type used by this class.
using rvalue_row_type = soagen::row_type;
@@ -2004,7 +2000,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return iterator{ *this, static_cast(*moved_pos) };
+ return iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -2043,7 +2039,7 @@ namespace soagen::examples
noexcept(soagen::has_nothrow_unordered_erase_member)
{
if (auto moved_pos = table_.unordered_erase(static_cast(pos)); moved_pos)
- return const_iterator{ *this, static_cast(*moved_pos) };
+ return const_iterator{ table_, static_cast(*moved_pos) };
return {};
}
@@ -2064,10 +2060,10 @@ namespace soagen::examples
SOAGEN_ALWAYS_INLINE
SOAGEN_CPP20_CONSTEXPR
spheres& swap_columns() //
- noexcept(noexcept(
- std::declval().template swap_columns(A), static_cast(B)>()))
+ noexcept(noexcept(std::declval()
+ .template swap_columns(A), static_cast(B)>()))
{
- table_.template swap_columns(A), static_cast(B)>();
+ table_.template swap_columns(A), static_cast(B)>();
return *this;
}
@@ -2686,7 +2682,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) & noexcept
+ soagen::row_type row(size_type index) & noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -2798,7 +2794,7 @@ namespace soagen::examples
template
SOAGEN_PURE_GETTER
SOAGEN_CPP20_CONSTEXPR
- soagen::row_type row(size_type index) const& noexcept
+ soagen::row_type row(size_type index) const& noexcept
{
if constexpr (sizeof...(Columns))
{
@@ -2854,67 +2850,67 @@ namespace soagen::examples
/// @{
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() & noexcept
+ constexpr soagen::iterator_type begin() & noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() & noexcept
+ constexpr soagen::iterator_type end() & noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type begin() && noexcept
{
- return { std::move(*this), 0 };
+ return { std::move(table_), 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
constexpr soagen::iterator_type end() && noexcept
{
- return { std::move(*this), static_cast(size()) };
+ return { std::move(table_), static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type begin() const& noexcept
+ constexpr soagen::iterator_type begin() const& noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type end() const& noexcept
+ constexpr soagen::iterator_type end() const& noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @brief Returns an iterator to the first row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cbegin() const& noexcept
+ constexpr soagen::iterator_type cbegin() const noexcept
{
- return { *this, 0 };
+ return { table_, 0 };
}
/// @brief Returns an iterator to one-past-the-last row in the table.
- template
+ template
SOAGEN_PURE_INLINE_GETTER
- constexpr soagen::iterator_type cend() const& noexcept
+ constexpr soagen::iterator_type cend() const noexcept
{
- return { *this, static_cast(size()) };
+ return { table_, static_cast(size()) };
}
/// @}
diff --git a/examples/shapes.natvis b/examples/shapes.natvis
index 418fd20..f6dd6e2 100644
--- a/examples/shapes.natvis
+++ b/examples/shapes.natvis
@@ -1,6 +1,6 @@
diff --git a/src/soagen/header_file.py b/src/soagen/header_file.py
index 1b540ff..39b78b0 100644
--- a/src/soagen/header_file.py
+++ b/src/soagen/header_file.py
@@ -238,10 +238,6 @@ def write(self, o: Writer):
for struct in self.structs:
struct.write_forward_declarations(o)
o()
- with Namespace(o, 'soagen'):
- for struct in self.structs:
- struct.write_soagen_specializations(o)
- o()
with Namespace(o, 'soagen::detail'):
names = set()
for struct in self.structs:
diff --git a/src/soagen/hpp/column_traits.hpp b/src/soagen/hpp/column_traits.hpp
index 2ccfdfa..2d58997 100644
--- a/src/soagen/hpp/column_traits.hpp
+++ b/src/soagen/hpp/column_traits.hpp
@@ -946,21 +946,24 @@ namespace soagen
using default_emplace_type = make_cref;
};
- /// @brief True if `T` is an instance of #soagen::column_traits.
- template
- inline constexpr bool is_column_traits = POXY_IMPLEMENTATION_DETAIL(false);
/// @cond
- template
- inline constexpr bool is_column_traits> = true;
- template
- inline constexpr bool is_column_traits> = true;
- template