From 577592c66eab5840d9ad4020f3a1b4092b2e579d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 18 Feb 2020 04:16:03 +0100 Subject: [PATCH] C++17: isolate problematic code segments (see Ticket #1138) as it turns out, "almost" the whole codebase compiles in C++17 mode. with the exception of two metaprogramming-related problems: - our "duck detector" for STL containers does not trigger anymore - the Metafunction to dissect Function sigantures (meta::_Fun) flounders --- src/common/subsystem-runner.hpp | 3 + src/lib/format-util.hpp | 3 + src/stage/workspace/dock-area.cpp | 3 + src/stage/workspace/panel-manager.cpp | 3 + src/steam/asset.cpp | 3 + src/steam/play/play-service.cpp | 3 + .../engine/dispatcher-interface-test.cpp | 3 + tests/library/diff/mutation-message-test.cpp | 3 + .../diff/tree-mutator-binding-test.cpp | 12 +++ tests/library/format-helper-test.cpp | 6 ++ tests/library/item-wrapper-test.cpp | 3 + tests/library/iter-chain-search-test.cpp | 6 ++ tests/library/iter-tree-explorer-test.cpp | 10 ++ tests/library/util-collection-test.cpp | 3 + tests/library/util-foreach-test.cpp | 6 ++ tests/library/verb-visitor-dispatch-test.cpp | 3 + tests/stage/test/test-nexus.cpp | 2 + wiki/thinkPad.ichthyo.mm | 96 ++++++++++++++++++- 18 files changed, 168 insertions(+), 3 deletions(-) diff --git a/src/common/subsystem-runner.hpp b/src/common/subsystem-runner.hpp index fe9808d1d..1d015ea40 100644 --- a/src/common/subsystem-runner.hpp +++ b/src/common/subsystem-runner.hpp @@ -193,7 +193,10 @@ namespace lumiera { throw error::Logic("Subsystem "+string(*susy)+" failed to start"); } +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility if (not and_all (susy->getPrerequisites(), isRunning() )) +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + if (true) ////FIXME { susy->triggerShutdown(); throw error::State("Unable to start all prerequisites of Subsystem "+string(*susy)); diff --git a/src/lib/format-util.hpp b/src/lib/format-util.hpp index 3d926e9f5..099fb1d0f 100644 --- a/src/lib/format-util.hpp +++ b/src/lib/format-util.hpp @@ -194,6 +194,7 @@ namespace util { using Coll = typename lib::meta::Strip::TypePlain; _RangeIter range(std::forward(coll)); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto strings = stringify (std::move (range.iter)); if (!strings) return ""; @@ -205,6 +206,8 @@ namespace util { size_t len = buffer.str().length(); ASSERT (len >= delim.length()); return buffer.str().substr(0, len - delim.length()); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + return "bääh"; } template diff --git a/src/stage/workspace/dock-area.cpp b/src/stage/workspace/dock-area.cpp index a78d0fe92..ce990ad16 100644 --- a/src/stage/workspace/dock-area.cpp +++ b/src/stage/workspace/dock-area.cpp @@ -147,10 +147,13 @@ namespace workspace { bool DockArea::hasPanel (const int description_index) { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility return util::has_any (panels_, [=](panel::Panel* panel) { return getPanelType(panel) == description_index; }); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + return false; /////FIXME } panel::Panel& diff --git a/src/stage/workspace/panel-manager.cpp b/src/stage/workspace/panel-manager.cpp index 92593695d..767cef434 100644 --- a/src/stage/workspace/panel-manager.cpp +++ b/src/stage/workspace/panel-manager.cpp @@ -140,10 +140,13 @@ namespace workspace { bool PanelManager::hasPanel (const int description_index) { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility return util::has_any (panels_, [=](panel::Panel* panel) { return getPanelType(panel) == description_index; }); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + return false; //////FIXME } panel::Panel& diff --git a/src/steam/asset.cpp b/src/steam/asset.cpp index 85055c5c8..d01f789f0 100644 --- a/src/steam/asset.cpp +++ b/src/steam/asset.cpp @@ -117,7 +117,10 @@ namespace asset { bool all_parents_enabled (const vector& parents) { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility return and_all (parents, check_isActive); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + return false; } /** diff --git a/src/steam/play/play-service.cpp b/src/steam/play/play-service.cpp index be8675eec..13d181d41 100644 --- a/src/steam/play/play-service.cpp +++ b/src/steam/play/play-service.cpp @@ -119,7 +119,10 @@ namespace play { bool isActive() const { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility return not and_all (processes_, isDead); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + return false; } private: diff --git a/tests/core/steam/engine/dispatcher-interface-test.cpp b/tests/core/steam/engine/dispatcher-interface-test.cpp index e2998336e..15ff5239b 100644 --- a/tests/core/steam/engine/dispatcher-interface-test.cpp +++ b/tests/core/steam/engine/dispatcher-interface-test.cpp @@ -211,7 +211,10 @@ namespace test { vector plannedChunk; lib::append_all (jobs, plannedChunk); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility Duration coveredTime (Offset(refPoint, last(plannedChunk).getNominalTime())); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + Duration coveredTime (lib::time::FSecs(23,55)); /////////////////////FIXME CHECK (coveredTime >= timings.getPlanningChunkDuration()); ///TODO nachfolgendes muß komplett umgeschrieben werden diff --git a/tests/library/diff/mutation-message-test.cpp b/tests/library/diff/mutation-message-test.cpp index 3bad00977..01fe8cf12 100644 --- a/tests/library/diff/mutation-message-test.cpp +++ b/tests/library/diff/mutation-message-test.cpp @@ -276,6 +276,7 @@ namespace test{ ,set(ATTRIB1) ,del(CHILD_T)}), steps); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility diffMsg = MutationMessage{steps}; CHECK (!isnil (diffMsg)); @@ -283,6 +284,8 @@ namespace test{ CHECK (set(ATTRIB1) == *++diffMsg); CHECK (del(CHILD_T) == *++diffMsg); CHECK (isnil (++diffMsg)); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } diff --git a/tests/library/diff/tree-mutator-binding-test.cpp b/tests/library/diff/tree-mutator-binding-test.cpp index 8059810b8..093427a08 100644 --- a/tests/library/diff/tree-mutator-binding-test.cpp +++ b/tests/library/diff/tree-mutator-binding-test.cpp @@ -408,7 +408,10 @@ namespace test{ mutator1.injectNew (ATTRIB1); CHECK (!isnil (target)); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility CHECK (contains(join(target), "≺α∣1≻")); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); mutator1.injectNew (ATTRIB3); mutator1.injectNew (ATTRIB3); @@ -417,6 +420,7 @@ namespace test{ mutator1.injectNew (CHILD_T); CHECK (mutator1.completeScope()); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto contents = stringify(eachElm(target)); CHECK ("≺α∣1≻" == *contents); ++contents; @@ -431,6 +435,8 @@ namespace test{ CHECK (contains(*contents, "∣78:56:34.012≻")); ++contents; CHECK (isnil (contents)); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); cout << "injected......" << join(target) <; @@ -166,6 +169,7 @@ namespace test { ++nn; CHECK (6 == *nn); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto sn = stringify (nn); CHECK ("6" == *sn); ++sn; @@ -182,6 +186,8 @@ namespace test { CHECK ("9" == *sn); ++sn; CHECK (isnil (sn)); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } diff --git a/tests/library/item-wrapper-test.cpp b/tests/library/item-wrapper-test.cpp index f336e066d..598d2b811 100644 --- a/tests/library/item-wrapper-test.cpp +++ b/tests/library/item-wrapper-test.cpp @@ -312,6 +312,7 @@ namespace test{ void verifyFunctionResult() { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility FunctionResult randomVal (std::rand); // function was never invoked, thus the remembered result is NIL @@ -330,6 +331,8 @@ namespace test{ CHECK (v2 == *randomVal); CHECK (v2 == *randomVal); CHECK (v1 != *randomVal); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } diff --git a/tests/library/iter-chain-search-test.cpp b/tests/library/iter-chain-search-test.cpp index 714af1695..a4e83ec66 100644 --- a/tests/library/iter-chain-search-test.cpp +++ b/tests/library/iter-chain-search-test.cpp @@ -117,6 +117,7 @@ namespace test{ void simpleSearch () { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto search = chainSearch(SPAM) .search("bacon") .search("tomato"); @@ -138,6 +139,8 @@ namespace test{ CHECK (not search); CHECK (isnil (search)); VERIFY_ERROR (ITER_EXHAUST, *search); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } @@ -152,6 +155,7 @@ namespace test{ void chainedIteration () { +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto search = chainSearch(SPAM) // Note: 1st filter step picks all s-words .search([](string const& str){ return startsWith (str, "s"); }); @@ -175,6 +179,8 @@ namespace test{ "bacon-tomato-and-" // any non-spam behind the 3rd spam "tomato-and" // any non-spam behind the 4th spam ""); // and any non-spam behind the final spam +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index cb8fc8470..1f657e38f 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -340,10 +340,13 @@ namespace test{ CHECK (materialise(jj) == "3--5-8--13"); // can even adapt STL container automatically +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto kk = treeExplore(numz); CHECK (!isnil (kk)); CHECK (1 == *kk); CHECK (materialise(kk) == "1--2-3--5-8--13"); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } @@ -392,10 +395,12 @@ namespace test{ .expand([](uint j){ return CountDown{j-1}; }) // expand-functor: Val > StateCore ); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility verify_treeExpandingIterator( treeExplore(CountDown{5}) .expand([](uint j){ return NumberSequence{j-1}; }) // expand-functor: Val > Iter ); // NOTE: different Iterator type than the source! +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility // lambda with side-effect and return type different from source iter vector> childBuffer; @@ -408,10 +413,12 @@ namespace test{ return childNumbz; }; +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility verify_treeExpandingIterator( treeExplore(CountDown{5}) .expand(expandIntoChildBuffer) // expand-functor: Val > STL-container& ); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility // test routine called the expansion functor five times CHECK (5 == childBuffer.size()); @@ -579,6 +586,7 @@ namespace test{ // demonstrate chaining of several transformation layers vector numz{1,-2,3,-5,8,-13}; +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility CHECK ("≺1≻-≺-2≻-≺3≻-≺-5≻-≺8≻-≺-13≻" == materialise (treeExplore(numz) .transform(formatify)) ); @@ -591,6 +599,8 @@ namespace test{ .transform(multiply) .transform(formatify) .transform(formatify)) ); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); // demonstrate the functor is evaluated only once per step diff --git a/tests/library/util-collection-test.cpp b/tests/library/util-collection-test.cpp index eb6292598..5d2a7f71f 100644 --- a/tests/library/util-collection-test.cpp +++ b/tests/library/util-collection-test.cpp @@ -96,8 +96,11 @@ namespace test { VecI container = someNumberz (NUM_ELMS); RangeI iterator(container.begin(), container.end()); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility verify_accessFirstLast (container, NUM_ELMS); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility verify_accessFirstLast (iterator, NUM_ELMS); + UNIMPLEMENTED ("C++17"); } diff --git a/tests/library/util-foreach-test.cpp b/tests/library/util-foreach-test.cpp index 5be9fc175..c500e78ec 100644 --- a/tests/library/util-foreach-test.cpp +++ b/tests/library/util-foreach-test.cpp @@ -131,6 +131,7 @@ namespace test { VecI container = buildTestNumberz (NUM_ELMS); RangeI iterator(container.begin(), container.end()); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility check_foreach_plain (container); check_foreach_plain (iterator); @@ -151,6 +152,8 @@ namespace test { CHECK (int(NUM_ELMS) ==container[0]); check_ref_argument_bind (container); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); CHECK (int(NUM_ELMS) ==container[0]); check_ref_argument_bind (iterator); @@ -410,6 +413,7 @@ namespace test { // fed the element pointer as "this" pointer of the member function for_each (elmPtrs, &TestElm::operation, _1 ); _NL_ +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility and_all (elmPtrs, &TestElm::operation, _1 ); _NL_ has_any (elmPtrs, &TestElm::operation, _1 ); _NL_ @@ -417,6 +421,8 @@ namespace test { for_each (elms, &TestElm::operation, _1 ); _NL_ and_all (elms, &TestElm::operation, _1 ); _NL_ has_any (elms, &TestElm::operation, _1 ); _NL_ +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); // note: it seems not to be possible to create a binder, which takes the "*this"-Argument by ref } diff --git a/tests/library/verb-visitor-dispatch-test.cpp b/tests/library/verb-visitor-dispatch-test.cpp index bd50835f6..2ff6922ed 100644 --- a/tests/library/verb-visitor-dispatch-test.cpp +++ b/tests/library/verb-visitor-dispatch-test.cpp @@ -198,6 +198,7 @@ namespace test{ { VerboseRenderer verbose; DiagnosticRenderer diagnostic; +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility auto render = [&](Receiver& renderer) { return join (lib::treeExplore(tokens) @@ -210,6 +211,8 @@ namespace test{ CHECK (render(diagnostic) == "woof(false,3)-honk(quaack)-honk(Hoonk)-woof(true,2)-moo(3)-meh()"); CHECK (render(verbose) == "haw-hawhaw-hawhaw-hawhaw-haw-quaack-quaack!-Hoonk-Hoonk!-Woof..Woof..-Moo__Moo__Moo-Meh?"); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility + UNIMPLEMENTED ("C++17"); } diff --git a/tests/stage/test/test-nexus.cpp b/tests/stage/test/test-nexus.cpp index 2eb38c2fd..508372757 100644 --- a/tests/stage/test/test-nexus.cpp +++ b/tests/stage/test/test-nexus.cpp @@ -496,9 +496,11 @@ namespace test{ { EventLog::ArgSeq strings; strings.reserve (argData.childSize()); +#if false //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility append_all (transformIterator (childData (argData.scope()) , util::toString) ,strings); +#endif //////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1138 : sort out C++17 compatibility return strings; } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 2509c69fc..23dd611aa 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -45338,8 +45338,8 @@ - - + + @@ -45361,7 +45361,7 @@ - + @@ -45504,6 +45504,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ src/lib/itertools.hpp:805 +

+

+ error: no type named 'Ret' in 'struct lib::meta::_Fun<std::__cxx11::basic_string<char> (*)(const std::__cxx11::basic_string<char>&) noexcept, void>' +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +