diff options
Diffstat (limited to 'src/propagation.h')
-rw-r--r-- | src/propagation.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/propagation.h b/src/propagation.h new file mode 100644 index 0000000..0bcb435 --- /dev/null +++ b/src/propagation.h @@ -0,0 +1,28 @@ +#pragma once + +#include "cuboid.h" +#include "concepts.h" + +namespace concepts { + +template <typename BUFFER> +concept CuboidConstructible = std::constructible_from<BUFFER, Cuboid>; + +template <typename BUFFER> +concept PopulationAccess = Arithmetic<typename BUFFER::value_t> + && requires(BUFFER& b) { + { b.get(unsigned{}, stage::pre_collision()) } -> std::same_as<typename BUFFER::value_t*>; + { b.get(unsigned{}, stage::post_collision()) } -> std::same_as<typename BUFFER::value_t*>; +}; + +template <typename BUFFER> +concept Propagatable = requires(BUFFER& b) { + b.stream(); +}; + +template <typename BUFFER> +concept PropagatablePopulationBuffer = CuboidConstructible<BUFFER> + && PopulationAccess<BUFFER> + && Propagatable<BUFFER>; + +} |