Performance improvements, better readme and complete python bindings
🧪 Test / test (push) Failing after 28m30s
🧪 Test / test (push) Failing after 28m30s
This commit is contained in:
+2
-20
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "channel.hpp"
|
||||
#include "diagnostics.hpp"
|
||||
#include "node.hpp"
|
||||
#include "inode.hpp"
|
||||
#include "port.hpp"
|
||||
#include "traits.hpp"
|
||||
|
||||
@@ -15,24 +15,6 @@
|
||||
|
||||
namespace kpn {
|
||||
|
||||
namespace detail {
|
||||
|
||||
// Produces std::tuple<T, T, ..., T> with N repetitions — used so that
|
||||
// Network::connect can do its normal return_tuple type-check against FanoutNode.
|
||||
template<typename T, std::size_t N, typename Seq = std::make_index_sequence<N>>
|
||||
struct repeat_tuple;
|
||||
|
||||
template<typename T, std::size_t N, std::size_t... Is>
|
||||
struct repeat_tuple<T, N, std::index_sequence<Is...>> {
|
||||
template<std::size_t> using always_T = T;
|
||||
using type = std::tuple<always_T<Is>...>;
|
||||
};
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
using repeat_tuple_t = typename repeat_tuple<T, N>::type;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// ── FanoutNode ────────────────────────────────────────────────────────────────
|
||||
//
|
||||
// Reads one item from its single input channel and pushes a copy to each of
|
||||
@@ -48,7 +30,7 @@ template<typename T, std::size_t N, std::size_t Id = 0>
|
||||
class FanoutNode : public INode {
|
||||
public:
|
||||
using args_tuple = std::tuple<T>;
|
||||
using return_tuple = detail::repeat_tuple_t<T, N>;
|
||||
using return_tuple = repeat_tuple_t<T, N>;
|
||||
using return_raw = return_tuple;
|
||||
|
||||
static constexpr std::size_t input_count = 1;
|
||||
|
||||
Reference in New Issue
Block a user