TreeExplorer: cover all the remaining cases supported for the expansion functor

This commit is contained in:
Fischlurch 2017-11-27 04:59:52 +01:00
parent 86856390e1
commit d8f7a22123
3 changed files with 29 additions and 7 deletions

View file

@ -258,6 +258,13 @@ namespace lib {
>
{ };
template<class SRC>
struct shall_use_Lumiera_Iter
: __and_<can_IterForEach<SRC>
,__not_<is_StateCore<SRC>>
>
{ };
template<class SRC, typename SEL=void>
struct _TreeExplorerTraits
@ -273,7 +280,7 @@ namespace lib {
};
template<class SRC>
struct _TreeExplorerTraits<SRC, enable_if<can_IterForEach<SRC>>>
struct _TreeExplorerTraits<SRC, enable_if<shall_use_Lumiera_Iter<SRC>>>
{
using SrcIter = typename std::remove_reference<SRC>::type;
};

View file

@ -354,11 +354,17 @@ namespace test{
// test routine called the expansion functor five times
CHECK (5 == childBuffer.size());
verify_treeExpandingIterator(
treeExplore(CountDown{5})
.expand([](CountDown const& core){ return CountDown{ yield(core) - 1}; })
);
verify_treeExpandingIterator(
treeExplore(CountDown{5})
.expand([](CountDown const& core){ return NumberSequence{ yield(core) - 1}; })
);
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1118 : GDB Segfault on loading the inferior
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1118 : Generated code works just fine and passes Test though
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1118 : GDB Segfault on loading the inferior
@ -366,6 +372,11 @@ namespace test{
treeExplore(CountDown{5})
.expand([](auto & it){ return CountDown{ *it - 1}; })
);
verify_treeExpandingIterator(
treeExplore(CountDown{5})
.expand([](auto it){ return decltype(it){ *it - 1}; })
);
}

View file

@ -5361,9 +5361,8 @@
<icon BUILTIN="button_ok"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1511227861867" ID="ID_1821706302" MODIFIED="1511571641506" TEXT="Fall-2 ">
<icon BUILTIN="flag-yellow"/>
<icon BUILTIN="pencil"/>
<node COLOR="#338800" CREATED="1511227861867" ID="ID_1821706302" MODIFIED="1511755074830" TEXT="Fall-2 ">
<icon BUILTIN="button_ok"/>
<node CREATED="1511227870346" ID="ID_797579225" MODIFIED="1511571541045" TEXT="verzahnte Implementierung">
<icon BUILTIN="info"/>
</node>
@ -5371,12 +5370,17 @@
<node COLOR="#338800" CREATED="1511227917971" ID="ID_200983707" MODIFIED="1511571722416" TEXT="Core&amp; -&gt; Core">
<icon BUILTIN="button_ok"/>
</node>
<node CREATED="1511227902005" ID="ID_1992381343" MODIFIED="1511571866703" TEXT="Core -&gt; Iter&lt;Val&gt;"/>
<node CREATED="1511571746395" ID="ID_1199592659" MODIFIED="1511571759405" TEXT="generisches Lambda">
<node COLOR="#338800" CREATED="1511227902005" ID="ID_1992381343" MODIFIED="1511754553025" TEXT="Core -&gt; Iter&lt;Val&gt;">
<icon BUILTIN="button_ok"/>
</node>
<node CREATED="1511571746395" ID="ID_1199592659" MODIFIED="1511755064482" TEXT="generisches Lambda">
<icon BUILTIN="button_ok"/>
<node COLOR="#338800" CREATED="1511227944392" ID="ID_881609766" MODIFIED="1511571897315" TEXT="Iter&lt;Val&gt;&amp; -&gt; Core">
<icon BUILTIN="button_ok"/>
</node>
<node CREATED="1511227925202" ID="ID_290152631" MODIFIED="1511571917720" TEXT="Iter&lt;Val&gt; -&gt; Iter&lt;Val&gt;"/>
<node COLOR="#338800" CREATED="1511227925202" ID="ID_290152631" MODIFIED="1511755056399" TEXT="Iter&lt;Val&gt; -&gt; Iter&lt;Val&gt;">
<icon BUILTIN="button_ok"/>
</node>
</node>
</node>
</node>