summaryrefslogtreecommitdiff
path: root/lib/core/c++
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-05-18 18:55:12 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-05-18 18:55:12 +0200
commit4f3f21f72602ab4ce49caa6e7264d369afc98977 (patch)
tree4575f1a8a9a9b74c69c579c5704b43ee775cc1ad /lib/core/c++
parenta8c333ce640b8ca2b1923f96ff13d4e6faf55c86 (diff)
downloadlibs-lbm-4f3f21f72602ab4ce49caa6e7264d369afc98977.tar.gz
Particle
Diffstat (limited to 'lib/core/c++')
-rw-r--r--lib/core/c++/iterator.hpp28
-rw-r--r--lib/core/c++/particle/particle.hpp7
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/core/c++/iterator.hpp b/lib/core/c++/iterator.hpp
index 866543a..696c521 100644
--- a/lib/core/c++/iterator.hpp
+++ b/lib/core/c++/iterator.hpp
@@ -50,6 +50,34 @@ public:
}
};
+template<typename... Tup>
+struct ct_tuple_iterator final {
+private:
+ template<typename Func, uint64_t i>
+ static constexpr saw::error_or<void> apply_i(
+ Func& func,
+ saw::data<sch::Tuple<Tup...>>& tup
+ ){
+ if constexpr ( i < sizeof...(Tup) ){
+ auto eov = func(tup.template get<i>());
+ if(eov.is_error()){
+ return eov;
+ }
+ return apply_i<Func,i+1u>(func,tup);
+ }
+
+ return saw::make_void();
+ }
+public:
+ template<typename Func>
+ static constexpr saw::error_or<void> apply(
+ Func&& func,
+ saw::data<sch::Tuple<Tup...>>& tup
+ ){
+ return apply_i<Func,0u>(func,tup);
+ }
+};
+
/* Ambiguous
template<typename Func>
void iterate_over(Func&& func, const saw::data<sch::FixedArray<sch::UInt64,3u>>& start, const saw::data<sch::FixedArray<sch::UInt64,3u>>& end, const saw::data<sch::FixedArray<sch::UInt64,3u>>& dist = {{{0u,0u,0u}}}){
diff --git a/lib/core/c++/particle/particle.hpp b/lib/core/c++/particle/particle.hpp
index 7af43dc..01429b2 100644
--- a/lib/core/c++/particle/particle.hpp
+++ b/lib/core/c++/particle/particle.hpp
@@ -238,5 +238,12 @@ constexpr auto broadphase_collision_check = [](
) -> bool{
return broadphase_collision_distance_squared<T,D,Collision>(left,coll_l,right,coll_r).first;
};
+
+
+
+namespace impl {
+
+}
+
}
}