#ifndef ALSK_ALSK_SKELETON_BONE_WHILE_H #define ALSK_ALSK_SKELETON_BONE_WHILE_H #include "../bonebase.h" namespace alsk { template struct While; template< typename Signature, typename Test_, typename TestLinks_, typename Task_, typename TaskLinks_ > struct While, tmp::Pack>: SkeletonBase { using Test = Test_; using TestLinks = TestLinks_; using Task = Task_; using TaskLinks = TaskLinks_; using Links = tmp::Pack; using PackP = tmp::Parameters; using PackR = Returns; using PackX = tmp::Pack<>; using Packs = arg::Placeholders; Test test; Task task; ~While() noexcept {}; // -Winline }; template<> struct SkeletonTraits { static constexpr bool serial = true; template static constexpr decltype(auto) traverse(std::size_t parDepth, Skeleton&& skeleton, F&& function, T&& init) { using TraverserTest = SkeletonTraversal::Test>; using TraverserTask = SkeletonTraversal::Task>; return function(parDepth, skeleton, TraverserTest::execute(parDepth, skeleton.task, function, std::forward(init)), TraverserTask::execute(parDepth, skeleton.task, function, std::forward(init)) ); } template static constexpr std::size_t parallelizability(Skeleton&&) noexcept { return 1; } }; template void skeletonTraversal(While const& s, F f) { f(s.test, 1); f(s.task, 1); } } #endif