[&]<std::size_t... I>(std::index_sequence<I...>) {
(SetupInput<I>(options, transport_manager, subscriber_queues[I], thread_pool, templated_topic_to_runtime_topic),
...);
}(std::make_index_sequence<INPUT_COUNT>());
would be a lot more readible as for constexpr( size_t I = 0; I < INPUT_COUNT; I++ )
SetupInput<I>(options, transport_manager, subscriber_queues[I], thread_pool, templated_topic_to_runtime_topic);
}
Yes, there's some syntax snags around it (right now I looks mutable, something like `for (constexpr size_t I : INPUT_COUNT)` might be better), but there has to be some sane middleground. const auto [...I] = std::make_index_sequence<INPUT_COUNT>{};
((SetupInput<I>(options, transport_manager, subscriber_queues[I], thread_pool, templated_topic_to_runtime_topic)),...);
yay!I thought the same, but then you lose the ability to control the increment step. For example, one might want to iterate pairwise.
Regarding syntax, you could mandate that the loop variable has to be declared `constexpr` as well, which makes it clear that it can't be modified in the loop body.
And I say that as someone using C++17 at work, not just a smug lisp weenie.
Turns out that const-call depth is limited to 512, but by implementation, not by the standard (which is undefined).
lol how? sed? that's not a "much easier", that's a hack. it's actually much easier to remove `using namespace` because then the compiler will catch resolution errors.
i actually didn't notice this was a header in which ok fine don't use `using namespace` but still this is java EE levels of boiler plate you've got going on;
void SetupInput(const basis::UnitInitializeOptions &options,
basis::core::transport::TransportManager *transport_manager,
basis::core::containers::SubscriberQueueSharedPtr &subscriber_queue,
basis::core::threading::ThreadPool *thread_pool,
const std::unordered_map<std::string, std::string> &templated_topic_to_runtime_topic) {
this signature is 90% namespace resolution - i have to squint to actually find the types...https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p26...