diff --git a/src/lib/hetero-data.hpp b/src/lib/hetero-data.hpp index 36cc5ed79..72fdb397b 100644 --- a/src/lib/hetero-data.hpp +++ b/src/lib/hetero-data.hpp @@ -286,7 +286,7 @@ namespace lib { * @internal implementation specialisation to mark the end of a chain */ template<> - class HeteroData + class HeteroData { public: static size_t constexpr size() { return 0; } @@ -305,9 +305,9 @@ namespace lib { */ template class HeteroData - : public HeteroData, meta::NullType>> + : public HeteroData, meta::Nil>> { - using _FrontBlock = HeteroData, meta::NullType>>; + using _FrontBlock = HeteroData, meta::Nil>>; public: using NewFrame = typename _FrontBlock::Frame; @@ -437,7 +437,7 @@ namespace std { // Specialisation to support C++ »Tuple Protocol« and structur using type = typename lib::HeteroData::template Elm_t; }; template - struct tuple_element > + struct tuple_element > { static_assert ("accessing element-type of an empty HeteroData block"); }; diff --git a/src/lib/meta/function-closure.hpp b/src/lib/meta/function-closure.hpp index 23511a2f4..cb0362714 100644 --- a/src/lib/meta/function-closure.hpp +++ b/src/lib/meta/function-closure.hpp @@ -400,9 +400,9 @@ namespace func{ }; template - struct PlaceholderTuple + struct PlaceholderTuple { - using List = NullType; + using List = Nil; }; diff --git a/src/lib/meta/generator-combinations.hpp b/src/lib/meta/generator-combinations.hpp index ca76faffe..dfec26c11 100644 --- a/src/lib/meta/generator-combinations.hpp +++ b/src/lib/meta/generator-combinations.hpp @@ -77,7 +77,7 @@ namespace meta{ template < class TYPES_1, class TYPES_2 ///< the two type collections to pick combinations from , template class _X_ ///< template with two arg types and a base type - , class BASE = NullType + , class BASE = Nil > struct InstantiateChainedCombinations : InstantiateChained< typename CartesianProduct::List diff --git a/src/lib/meta/generator.hpp b/src/lib/meta/generator.hpp index c273521fd..40c828bb1 100644 --- a/src/lib/meta/generator.hpp +++ b/src/lib/meta/generator.hpp @@ -66,18 +66,18 @@ namespace meta{ template < class TYPES // List of Types , template class _X_ // your-template-goes-here - , class BASE = NullType // Base class at end of chain + , class BASE = Nil // Base class at end of chain > class InstantiateForEach; template class _X_, class BASE> - class InstantiateForEach + class InstantiateForEach : public BASE { public: - typedef BASE Unit; - typedef NullType Next; + using Unit = BASE; + using Next = Nil; }; @@ -91,8 +91,8 @@ namespace meta{ public InstantiateForEach { public: - typedef _X_ Unit; - typedef InstantiateForEach Next; + using Unit = _X_; + using Next = InstantiateForEach; }; @@ -115,18 +115,18 @@ namespace meta{ template < class TYPES // List of Types , template class _X_ // your-template-goes-here - , class BASE = NullType // Base class at end of chain + , class BASE = Nil // Base class at end of chain > class InstantiateChained; template class _X_, class BASE> - class InstantiateChained + class InstantiateChained : public BASE { public: - typedef BASE Unit; - typedef NullType Next; + using Unit = BASE; + using Next = Nil; }; @@ -141,8 +141,8 @@ namespace meta{ > { public: - typedef InstantiateChained Next; - typedef _X_ Unit; + using Next = InstantiateChained; + using Unit = _X_; }; @@ -159,7 +159,7 @@ namespace meta{ template < class TYPES // List of Types , template class _X_ // your-template-goes-here - , class BASE = NullType // Base class at end of chain + , class BASE = Nil // Base class at end of chain , uint i = 0 // incremented on each instantiation > class InstantiateWithIndex; @@ -169,12 +169,12 @@ namespace meta{ , class BASE , uint i > - class InstantiateWithIndex + class InstantiateWithIndex : public BASE { public: - typedef BASE Unit; - typedef NullType Next; + using Unit = BASE; + using Next = Nil; enum{ COUNT = i }; }; @@ -192,8 +192,8 @@ namespace meta{ > { public: - typedef InstantiateWithIndex Next; - typedef _X_ Unit; + using Next = InstantiateWithIndex; + using Unit = _X_; enum{ COUNT = Next::COUNT }; }; diff --git a/src/lib/meta/tuple-helper.hpp b/src/lib/meta/tuple-helper.hpp index ee6e39b16..cdf4b885d 100644 --- a/src/lib/meta/tuple-helper.hpp +++ b/src/lib/meta/tuple-helper.hpp @@ -148,13 +148,13 @@ namespace meta { }; /** - * temporary workaround: strip trailing NullType entries + * temporary workaround: strip trailing Nil-Type entries * prior to rebinding to the `std::tuple` type. */ template struct BuildTupleType> { - using VariadicSeq = typename StripNullType>::Seq; + using VariadicSeq = typename StripNil>::Seq; using Type = typename BuildTupleType::Type; }; @@ -167,7 +167,7 @@ namespace meta { }; template<> - struct BuildTupleType + struct BuildTupleType { using Type = typename BuildTupleType>::Type; }; @@ -348,7 +348,7 @@ namespace meta { class BuildTupleAccessor< _X_, TySeq<>, TUP, i> { public: - using Product = _X_; // Note: i == tuple size + using Product = _X_; // Note: i == tuple size }; ///////////////////////////////////////////////////////////////////////////////////TICKET #987 : the following specialisation will be obsoleted by the removal of old-style type-sequences template @@ -359,7 +359,7 @@ namespace meta { class BuildTupleAccessor< _X_, TyOLD<>, TUP, i> { public: - using Product = _X_; // Note: i == tuple size + using Product = _X_; // Note: i == tuple size }; @@ -390,7 +390,7 @@ namespace meta { }; template - struct TupleElementDisplayer + struct TupleElementDisplayer : TUP { TupleElementDisplayer (TUP const& tup) diff --git a/src/lib/meta/typelist-manip.hpp b/src/lib/meta/typelist-manip.hpp index d8e933348..52de4b86d 100644 --- a/src/lib/meta/typelist-manip.hpp +++ b/src/lib/meta/typelist-manip.hpp @@ -57,7 +57,7 @@ namespace meta { template struct Pick { - typedef NullType Type; + typedef Nil Type; }; template struct Pick, 0> @@ -99,7 +99,7 @@ namespace meta { struct Filter; template class _P_> - struct Filter { typedef NullType List; }; + struct Filter { typedef Nil List; }; template< class TY, class TYPES , template class _P_ @@ -113,7 +113,7 @@ namespace meta { /** append lists-of-types */ template - struct Append { typedef Node::List> List; }; + struct Append { typedef Node::List> List; }; template< class TY, class TYPES , class TAIL @@ -121,19 +121,19 @@ namespace meta { struct Append, TAIL> { typedef Node::List> List; }; template - struct Append> { typedef Node List; }; + struct Append> { typedef Node List; }; template - struct Append, NullType> { typedef Node List; }; + struct Append, Nil> { typedef Node List; }; template - struct Append { typedef Node List; }; + struct Append { typedef Node List; }; template - struct Append { typedef Node List; }; + struct Append { typedef Node List; }; template<> - struct Append { typedef NullType List; }; + struct Append { typedef Nil List; }; @@ -143,11 +143,11 @@ namespace meta { struct SplitLast; template<> - struct SplitLast { typedef NullType Type; - typedef NullType List; }; + struct SplitLast { typedef Nil Type; + typedef Nil List; }; template - struct SplitLast> { typedef TY Type; - typedef NullType List; }; + struct SplitLast> { typedef TY Type; + typedef Nil List; }; template struct SplitLast> { typedef typename SplitLast::Type Type; @@ -163,7 +163,7 @@ namespace meta { * into an base typelist, starting at given index. * @return either the combined (spliced) List, or * the Front/Back part before or after the Overlay - * @note using a NullType as OVERLAY allows to extract + * @note using a Nil as OVERLAY allows to extract * an arbitrary Front/Back part of the list */ template @@ -178,18 +178,18 @@ namespace meta { template struct Splice,Node,0> { typedef Node::List> List; - typedef NullType Front; + typedef Nil Front; typedef typename Splice::Back Back; }; template - struct Splice, NullType, 0> { typedef Node List; - typedef NullType Front; + struct Splice, Nil, 0> { typedef Node List; + typedef Nil Front; typedef Node Back; }; template - struct Splice { typedef NullType List; - typedef NullType Front; - typedef NullType Back; }; + struct Splice { typedef Nil List; + typedef Nil Front; + typedef Nil Back; }; @@ -206,23 +206,23 @@ namespace meta { { typedef Node List; ///< the complete list typedef T Head; ///< first element - typedef Node First; ///< a list containing the first element + typedef Node First; ///< a list containing the first element typedef TYPES Tail; ///< remainder of the list starting with the second elm. typedef typename SplitLast::List Prefix;///< all of the list, up to but excluding the last element typedef typename SplitLast::Type End; ///< the last element - typedef Node Last; ///< a list containing the last element + typedef Node Last; ///< a list containing the last element }; template<> - struct Dissect + struct Dissect { - typedef NullType List; - typedef NullType Head; - typedef NullType First; - typedef NullType Tail; - typedef NullType Prefix; - typedef NullType End; - typedef NullType Last; + typedef Nil List; + typedef Nil Head; + typedef Nil First; + typedef Nil Tail; + typedef Nil Prefix; + typedef Nil End; + typedef Nil Last; }; @@ -233,13 +233,13 @@ namespace meta { * yielding a list-of lists-of-types */ template - struct PrefixAll { typedef Node< typename Append::List, NullType> List; }; + struct PrefixAll { typedef Node< typename Append::List, Nil> List; }; template - struct PrefixAll { typedef NullType List; }; + struct PrefixAll { typedef Nil List; }; template - struct PrefixAll { typedef Node< typename Append::List, NullType> List; }; + struct PrefixAll { typedef Node< typename Append::List, Nil> List; }; template< class T , class TY, class TYPES @@ -261,7 +261,7 @@ namespace meta { struct Distribute { typedef typename PrefixAll::List List; }; template - struct Distribute { typedef NullType List; }; + struct Distribute { typedef Nil List; }; template< class TY, class TYPES , class TAIL @@ -287,10 +287,10 @@ namespace meta { template< class X , template class _ENUM_> struct Combine { typedef typename Distribute< typename _ENUM_::List - , Node + , Node >::List List; }; template< template class _ENUM_> - struct Combine { typedef NodeNull List; }; + struct Combine { typedef NilNode List; }; template< class TY, class TYPES , template class _ENUM_> @@ -304,7 +304,7 @@ namespace meta { template struct FlagOnOff { - typedef Node> List; + typedef Node> List; }; diff --git a/src/lib/meta/typelist-util.hpp b/src/lib/meta/typelist-util.hpp index cee935afe..854c26502 100644 --- a/src/lib/meta/typelist-util.hpp +++ b/src/lib/meta/typelist-util.hpp @@ -51,7 +51,7 @@ namespace meta { template struct count; template<> - struct count + struct count { enum{ value = 0 }; }; @@ -68,7 +68,7 @@ namespace meta { template struct maxSize; template<> - struct maxSize + struct maxSize { static constexpr int value = 0; }; @@ -87,7 +87,7 @@ namespace meta { template struct maxAlign; template<> - struct maxAlign + struct maxAlign { static constexpr int value = 0; }; @@ -138,15 +138,15 @@ namespace meta { struct ConstAll; template<> - struct ConstAll + struct ConstAll { - typedef NullType List; + using List = Nil; }; template struct ConstAll> { - typedef Node::List> List; + using List = Node::List>; }; diff --git a/src/lib/meta/typelist.hpp b/src/lib/meta/typelist.hpp index e0d84be13..6053b3c57 100644 --- a/src/lib/meta/typelist.hpp +++ b/src/lib/meta/typelist.hpp @@ -10,16 +10,16 @@   option) any later version. See the file COPYING for further details. ==================================================================== -This code is heavily inspired by +This code is heavily inspired by The Loki Library (loki-lib/trunk/include/loki/Sequence.h) Copyright (c) 2001 by Andrei Alexandrescu Copyright (c) 2005 by Peter Kümmel This Loki code accompanies the book: Alexandrescu, Andrei. "Modern C++ Design: Generic Programming - and Design Patterns Applied". + and Design Patterns Applied". Copyright (c) 2001. Addison-Wesley. ISBN 0201704315 - - Loki Copyright Notice: + + Loki Copyright Notice: Permission to use, copy, modify, distribute and sell this software for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this @@ -32,14 +32,16 @@ This code is heavily inspired by /** @file typelist.hpp ** A template metaprogramming technique for manipulating collections of types. ** Effectively this is a tailored and simplified version of what can be found in the Loki library. - ** We use it in other generic library-style code to generate repetitive code. If you tend to find - ** template metaprogramming (or functional programming in general) offending, please ignore the - ** technical details and just consider the benefit of such an simplification for the client code. - ** - ** Interface for using this facility is the template Types(.....) for up to 20 Type parameters. + ** We use it in other generic library-style code to generate repetitive code. + ** @remark If you tend to find the use of template metaprogramming detrimental + ** (or functional programming and generally any kind of abstraction) + ** please kindly ignore the technical details and just consider the + ** benefit of simplification for the client code. + ** + ** Interface for using this facility is the template `Types`. ** To start typelist processing, other templates typically pick up the Types<...>::List type. - ** This allows for LISP-style list processing, with a pattern match on either Node - ** or NullType to terminate recursion. In C++ template metaprogramming, "pattern match" + ** This allows for LISP-style list processing, with a pattern match on either `Node` + ** or the type `Nil` to terminate recursion. In C++ template metaprogramming, "pattern match" ** is done by partial template specialisations (the compiler will pick up and thus ** match the template parameters). A typedef acts like a declaration in normal ** programming. Because such a "declaration" can't be changed after the fact, @@ -74,44 +76,44 @@ This code is heavily inspired by namespace lib { namespace meta { - struct NullType - { - typedef NullType List; + struct Nil + { + using List = Nil; }; - template + template struct Node { - typedef Node List; - typedef H Head; - typedef T Tail; + using List = Node; + using Head = H; + using Tail = T; }; - typedef Node NodeNull; + using NilNode = Node; template - < class T01=NullType - , class T02=NullType - , class T03=NullType - , class T04=NullType - , class T05=NullType - , class T06=NullType - , class T07=NullType - , class T08=NullType - , class T09=NullType - , class T10=NullType - , class T11=NullType - , class T12=NullType - , class T13=NullType - , class T14=NullType - , class T15=NullType - , class T16=NullType - , class T17=NullType - , class T18=NullType - , class T19=NullType - , class T20=NullType + < class T01=Nil + , class T02=Nil + , class T03=Nil + , class T04=Nil + , class T05=Nil + , class T06=Nil + , class T07=Nil + , class T08=Nil + , class T09=Nil + , class T10=Nil + , class T11=Nil + , class T12=Nil + , class T13=Nil + , class T14=Nil + , class T15=Nil + , class T16=Nil + , class T17=Nil + , class T18=Nil + , class T19=Nil + , class T20=Nil > class TyOLD { @@ -125,10 +127,10 @@ namespace meta { using Seq = TyOLD; }; - template<> + template<> struct TyOLD<> { - using List = NullType; + using List = Nil; using Seq = TyOLD<>; }; @@ -139,9 +141,9 @@ namespace meta { * alternative definition of "type sequence", * already using variadic template parameters. * @remarks the problem with our existing type sequence type - * is that it fills the end of each sequence with NullType, + * is that it fills the end of each sequence with Nil, * which was the only way to get a flexible type sequence - * prior to C++11. Unfortunately these trailing NullType + * prior to C++11. Unfortunately these trailing Nil * entries do not play well with other variadic defs. * @deprecated when we switch our primary type sequence type * to variadic parameters, this type will be obsoleted. ////////////////////////////////////TICKET #987 : make lib::meta::Types variadic diff --git a/src/lib/meta/typeseq-util.hpp b/src/lib/meta/typeseq-util.hpp index a42ef1dcb..c258795cf 100644 --- a/src/lib/meta/typeseq-util.hpp +++ b/src/lib/meta/typeseq-util.hpp @@ -166,16 +166,16 @@ namespace meta { >::Seq; }; template<> - struct TySeq + struct TySeq { - using List = NullType; + using List = Nil; using Seq = TySeq<>; }; //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #987 temporary WORKAROUND -- to be obsoleted /** - * temporary workaround: strip trailing NullType entries from a + * temporary workaround: strip trailing Nil entries from a * type sequence, to make it compatible with new-style variadic * template definitions. * @note the result type is a TySec, to keep it apart from our @@ -183,24 +183,24 @@ namespace meta { * @deprecated necessary for the transition to variadic sequences ////////////////////////////////////TICKET #987 : make lib::meta::Types variadic */ template - struct StripNullType; + struct StripNil; template - struct StripNullType> + struct StripNil> { - using TailSeq = typename StripNullType>::Seq; + using TailSeq = typename StripNil>::Seq; using Seq = typename Prepend::Seq; }; template - struct StripNullType> + struct StripNil> { using Seq = TySeq<>; // NOTE: this causes the result to be a TySeq }; ///////////////////////////////////////////////////////////////////////////////////TICKET #987 : the following specialisation is a catch-all and becomes obsolete template - struct StripNullType> + struct StripNil> { using Seq = TySeq; }; @@ -237,20 +237,20 @@ namespace meta { template<> struct Split> { - using List = NullType; + using List = Nil; - using Head = NullType; + using Head = Nil; using First = TySeq<>; using Tail = TySeq<>; // for finding the end we need the help of typelist-util.hpp - using PrefixList = NullType; - using TailList = NullType; + using PrefixList = Nil; + using TailList = Nil; using Prefix = TySeq<>; using Last = TySeq<>; - using End = NullType; + using End = Nil; }; ///////////////////////////////////////////////////////////////////////////////////TICKET #987 : the following specialisation will be obsoleted by the removal of old-style type-sequences template< typename T01 @@ -309,7 +309,7 @@ namespace meta { /** * Helper: generate a type sequence left shifted - * by i steps, filling in NullType at the end + * by i steps, filling in Nil at the end */ template class Shifted @@ -326,6 +326,7 @@ namespace meta { typedef TYPES Type; typedef typename Split::Head Head; }; + ///////////////////////////////////////////////////////////////////////////////////TICKET #987 : reimplement for variadic type-sequences diff --git a/src/lib/meta/variadic-helper.hpp b/src/lib/meta/variadic-helper.hpp index 60a2dcbba..dd2bf709d 100644 --- a/src/lib/meta/variadic-helper.hpp +++ b/src/lib/meta/variadic-helper.hpp @@ -143,7 +143,7 @@ namespace meta { template struct BuildIdxIter> { - ///////////////////////TICKET #987 : since Types is not variadic, need to strip NullType here (instead of just using sizeof...(TYPES) + ///////////////////////TICKET #987 : since Types is not variadic, need to strip Nil-Type here (instead of just using sizeof...(TYPES) enum {SIZ = lib::meta::count::List>::value }; using Builder = BuildIndexSeq; diff --git a/src/lib/meta/variadic-rebind.hpp b/src/lib/meta/variadic-rebind.hpp index 3acc63783..19b30ce9a 100644 --- a/src/lib/meta/variadic-rebind.hpp +++ b/src/lib/meta/variadic-rebind.hpp @@ -103,7 +103,7 @@ namespace meta { * A secondary helper template variant is provided for rebinding * while prepending or appending a single type parameter. * @note does not work with empty sequences; also the penultimate - * of a one-element sequence is mapped to NullType + * of a one-element sequence is mapped to the `Nil`-type */ template class L, typename...XS> struct _Vari; @@ -129,7 +129,7 @@ namespace meta { struct _Vari { using Ultima = X; - using Penult = NullType; ///< marker for undefined + using Penult = Nil; ///< marker for undefined using Remain = L; using Revers = L; using Prefix = L<>; diff --git a/src/lib/parse.hpp b/src/lib/parse.hpp index fc3a5fd1c..4f483d6c1 100644 --- a/src/lib/parse.hpp +++ b/src/lib/parse.hpp @@ -162,8 +162,8 @@ namespace util { using std::optional; using lib::meta::_Fun; using lib::meta::has_Sig; - using lib::meta::NullType; using lib::meta::_Vari; + using lib::meta::Nil; using std::decay_t; using std::tuple; using std::array; @@ -221,14 +221,14 @@ namespace util { /** »Null-Connex« which always successfully accepts the empty sequence */ inline auto - buildConnex(NullType) + buildConnex(Nil) { - return Connex{[](StrView) -> Eval + return Connex{[](StrView) -> Eval { - return {NullType{}}; + return {Nil()}; }}; } - using NulP = decltype(buildConnex (NullType())); + using NulP = decltype(buildConnex (Nil())); /** @@ -729,7 +729,7 @@ namespace util { }; /* === Deduction guide : how to construct a Parser === */ - Parser(NullType) -> Parser; + Parser(Nil) -> Parser; Parser(regex &&) -> Parser; Parser(regex const&) -> Parser; Parser(string const&) -> Parser; @@ -787,7 +787,7 @@ namespace util { using Result = typename PAR::Result; Syntax() - : parse_{NullType()} + : parse_{Nil()} { } explicit @@ -948,21 +948,21 @@ namespace util { inline auto accept_repeated (uint min, uint max, SPEC&& clauseDef) { - return accept_repeated (min, max, NullType{}, forward(clauseDef)); + return accept_repeated (min, max, Nil{}, forward(clauseDef)); } template inline auto accept_repeated (uint cnt, SPEC&& clauseDef) { - return accept_repeated (cnt, NullType{}, forward(clauseDef)); + return accept_repeated (cnt, Nil{}, forward(clauseDef)); } template inline auto accept_repeated (SPEC&& clauseDef) { - return accept_repeated (NullType{}, forward(clauseDef)); + return accept_repeated (Nil{}, forward(clauseDef)); } /** diff --git a/src/lib/time/formats.hpp b/src/lib/time/formats.hpp index 4d4a6468e..c26b84518 100644 --- a/src/lib/time/formats.hpp +++ b/src/lib/time/formats.hpp @@ -168,7 +168,7 @@ namespace time { using lib::meta::TyOLD; using lib::meta::Node; - using lib::meta::NullType; + using lib::meta::Nil; /** * Descriptor to denote support for a specific (timecode) format. @@ -204,9 +204,9 @@ namespace time { flags_.set (typeID()); return define(FS()); } - Supported define(NullType) { return *this;} ///< @internal recursion end + Supported define(Nil) { return *this;} ///< @internal recursion end - Supported() { } ///< @note use #formats to set up a new descriptor + Supported() { } ///< @note use #formats to set up a new descriptor public: diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index 429c83fb6..869d561ba 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -98,9 +98,9 @@ namespace lib { namespace variant { // implementation metaprogramming helpers using std::remove_reference; - using meta::NullType; using meta::TyOLD; using meta::Node; + using meta::Nil; template @@ -137,7 +137,7 @@ namespace lib { { }; template - struct CanBuildFrom + struct CanBuildFrom : std::false_type { }; diff --git a/src/lib/visitor.hpp b/src/lib/visitor.hpp index 2f0c5b721..5a5dac9bb 100644 --- a/src/lib/visitor.hpp +++ b/src/lib/visitor.hpp @@ -138,7 +138,7 @@ namespace visitor { < class TOOLImpl, class BASE > - class Applicable + class Applicable : public BASE { } ; diff --git a/src/steam/control/command-def.hpp b/src/steam/control/command-def.hpp index 54bff4e3b..420338706 100644 --- a/src/steam/control/command-def.hpp +++ b/src/steam/control/command-def.hpp @@ -77,7 +77,6 @@ namespace control { using lib::Symbol; using lib::meta::_Fun; - using lib::meta::NullType; using lib::meta::TyOLD; using lib::meta::Tuple; diff --git a/src/steam/control/command-op-closure.hpp b/src/steam/control/command-op-closure.hpp index 1805a38d0..42831f576 100644 --- a/src/steam/control/command-op-closure.hpp +++ b/src/steam/control/command-op-closure.hpp @@ -52,8 +52,8 @@ namespace control { using lib::meta::Tuple; using lib::meta::BuildTupleAccessor; using lib::meta::func::TupleApplicator; - using lib::meta::NullType; using lib::meta::buildTuple; + using lib::meta::Nil; using lib::TypedAllocationManager; using std::function; @@ -94,7 +94,7 @@ namespace control { }; template - class ParamAccessor ///< used for recursion end of implementation functions + class ParamAccessor ///< used for recursion end of implementation functions : public TUP { public: diff --git a/src/steam/engine/feed-manifold.hpp b/src/steam/engine/feed-manifold.hpp index 3d9b7c72d..bc94f88f5 100644 --- a/src/steam/engine/feed-manifold.hpp +++ b/src/steam/engine/feed-manifold.hpp @@ -100,9 +100,9 @@ namespace engine { using lib::meta::is_Structured; using lib::meta::forEachIDX; using lib::meta::ElmTypes; - using lib::meta::NullType; using lib::meta::Tagged; using lib::meta::TySeq; + using lib::meta::Nil; using std::is_pointer; using std::is_reference; using std::is_convertible; @@ -372,7 +372,7 @@ namespace engine { using enable_if_hasParam = typename lib::meta::enable_if_c<_ProcFun::hasParam()>::type; template - using NotProvided = Tagged; + using NotProvided = Tagged; template using Provide_if = conditional_t>; diff --git a/src/steam/engine/proc-node.cpp b/src/steam/engine/proc-node.cpp index d81bd1170..814da62f4 100644 --- a/src/steam/engine/proc-node.cpp +++ b/src/steam/engine/proc-node.cpp @@ -65,11 +65,11 @@ namespace engine { /* ===== Parse nested spec ===== */ + using lib::meta::Nil; using util::parse::accept; using util::parse::accept_bracket; using util::parse::accept_repeated; using util::parse::expectResult; - using lib::meta::NullType; using std::regex_match; using std::regex; @@ -91,13 +91,13 @@ namespace engine { regex CLOSING{esc+CLO}; regex NON_PAREN{R"_([^\\)_"+esc+OPE+esc+CLO+"]+"}; - static auto paren = expectResult(); + static auto paren = expectResult(); auto parenContent = accept_repeated(accept(NON_PAREN) .alt(ESCAPE) .alt(quote) .alt(paren)); - paren = accept_bracket(OPENING,CLOSING, parenContent).bind([](auto){ return NullType{}; }); + paren = accept_bracket(OPENING,CLOSING, parenContent).bind([](auto){ return Nil{}; }); return paren; } @@ -403,7 +403,7 @@ namespace engine { namespace {// create a »backdoor access« into actual weaving-pattern instances - using _DummyProc = void(&)(NullType*); + using _DummyProc = void(&)(Nil*); using _DummyProto = FeedPrototype<_DummyProc>; using _DummyMediaWeaving = MediaWeavingPattern<_DummyProto>; using _RecastMediaWeaving = _TurnoutDiagnostic<_DummyMediaWeaving>; diff --git a/src/steam/mobject/session/session-service-defaults.hpp b/src/steam/mobject/session/session-service-defaults.hpp index 21e00a873..1a465c246 100644 --- a/src/steam/mobject/session/session-service-defaults.hpp +++ b/src/steam/mobject/session/session-service-defaults.hpp @@ -38,7 +38,7 @@ namespace session { // using lib::meta::InstantiateChained; // using lib::meta::InheritFrom; -// using lib::meta::NullType; +// using lib::meta::Nil; class SessionServiceDefaults diff --git a/src/steam/mobject/session/session-service-fetch.hpp b/src/steam/mobject/session/session-service-fetch.hpp index 914efc35d..271c2caa5 100644 --- a/src/steam/mobject/session/session-service-fetch.hpp +++ b/src/steam/mobject/session/session-service-fetch.hpp @@ -41,7 +41,7 @@ namespace session { // using lib::meta::InstantiateChained; // using lib::meta::InheritFrom; -// using lib::meta::NullType; +// using lib::meta::Nil; /** * Implementation-level service for resolving an Placement-ID. diff --git a/tests/library/hetero-data-test.cpp b/tests/library/hetero-data-test.cpp index fb2c1a5a8..8988878c7 100644 --- a/tests/library/hetero-data-test.cpp +++ b/tests/library/hetero-data-test.cpp @@ -170,7 +170,7 @@ namespace test{ CHECK (x2 == "Φ"_expect); // auto& [z0,z1,z2,z3] = chain2; // Error: 4 names provided for structured binding, while HeteroData... decomposes into 3 elements -// auto& [z0,z1,z2] = b1; // Error: HeteroData, NullType> >' decomposes into 1 element +// auto& [z0,z1,z2] = b1; // Error: HeteroData, Nil> >' decomposes into 1 element } diff --git a/tests/library/meta/generator-combinations-test.cpp b/tests/library/meta/generator-combinations-test.cpp index 60d2e8794..cdafc66db 100644 --- a/tests/library/meta/generator-combinations-test.cpp +++ b/tests/library/meta/generator-combinations-test.cpp @@ -68,7 +68,7 @@ namespace test { }; template<> - struct TestCase + struct TestCase { static string visitAll() @@ -76,7 +76,7 @@ namespace test { return "-|"; } }; - typedef TestCase IterationEnd; + typedef TestCase IterationEnd; } // (End) test data diff --git a/tests/library/meta/meta-utils-test.cpp b/tests/library/meta/meta-utils-test.cpp index bf93b4970..602de7d13 100644 --- a/tests/library/meta/meta-utils-test.cpp +++ b/tests/library/meta/meta-utils-test.cpp @@ -186,7 +186,7 @@ namespace test { CHECK ((not is_Structured())); CHECK ((not is_Structured())); CHECK ((not is_Structured())); - CHECK ((not is_Structured >())); + CHECK ((not is_Structured >())); // the following indeed support C++ tuple protocol CHECK (( is_Structured >())); diff --git a/tests/library/meta/tuple-helper-test.cpp b/tests/library/meta/tuple-helper-test.cpp index 94adcc37c..deb020cf4 100644 --- a/tests/library/meta/tuple-helper-test.cpp +++ b/tests/library/meta/tuple-helper-test.cpp @@ -125,8 +125,8 @@ namespace test { Prepend prep (22, 11,33,Num<5>()); DUMPVAL (prep); - typedef Tuple > NulT; // plain-flat empty Tuple - typedef Tuple NulL; // list-style empty Tuple + using NulT = Tuple >; // plain-flat empty Tuple + using NulL = Tuple; // list-style empty Tuple NulT nulT; // and these, too, can be instantiated NulL nulL; @@ -139,7 +139,7 @@ namespace test { CHECK (is_Tuple()); CHECK (is_Tuple()); CHECK (is_Tuple()); - CHECK (!is_Tuple()); + CHECK (not is_Tuple()); cout << tup1 < struct CountDown { typedef NullType List; }; - template<> struct CountDown> { typedef Node, NullType> List; }; + template struct CountDown { typedef Nil List; }; + template<> struct CountDown> { typedef Node, Nil> List; }; template struct CountDown> { typedef Node, typename CountDown>::List> List; }; @@ -101,7 +101,7 @@ namespace meta { /** debugging template, * printing the "number" used for instantiation on ctor call */ - template + template struct Printer : BASE { @@ -109,7 +109,7 @@ namespace meta { }; template - struct Printer + struct Printer : BASE { static string print () { return _Fmt("-<%u>%s") % "·" % BASE::print(); } diff --git a/tests/library/meta/typelist-manip-test.cpp b/tests/library/meta/typelist-manip-test.cpp index 901d5944c..75d66917e 100644 --- a/tests/library/meta/typelist-manip-test.cpp +++ b/tests/library/meta/typelist-manip-test.cpp @@ -75,7 +75,7 @@ namespace test { * @test check utilities for manipulating lists-of-types. * - build an list of constant-wrapper-types and * print them for debugging purpose. - * - append lists, single elements and NullType + * - append lists, single elements and Nil-Type * in various combinations * - manipulations like splice, get end, dissect * - filtering out some types from a typelist by @@ -124,48 +124,48 @@ namespace test { Pick::Type e1; Pick::Type e2; - typedef Pick::Type E3; - typedef Pick::Type Nil; - typedef Pick::Type Irrelevant; + using E3 = Pick::Type; + using NilE = Pick::Type; + using Irrelevant = Pick::Type; CHECK (5 == e0); CHECK (6 == e1); CHECK (7 == e2); - CHECK ((is_same ::value)); - CHECK ((is_same ::value)); - CHECK ((is_same::value)); + CHECK ((is_same ::value)); + CHECK ((is_same ::value)); + CHECK ((is_same::value)); } void check_append () { - typedef Append Append1; + using Append1 = Append; DISPLAY (Append1); - typedef Append,Num<22>> Append2; + using Append2 = Append,Num<22>>; DISPLAY (Append2); - typedef Append,NullType> Append3; + using Append3 = Append,Nil>; DISPLAY (Append3); - typedef Append> Append4; + using Append4 = Append>; DISPLAY (Append4); - typedef Append Append5; + using Append5 = Append; DISPLAY (Append5); - typedef Append Append6; + using Append6 = Append; DISPLAY (Append6); - typedef Append,List2> Append7; + using Append7 = Append,List2>; DISPLAY (Append7); - typedef Append> Append8; + using Append8 = Append>; DISPLAY (Append8); - typedef Append Append9; + using Append9 = Append; DISPLAY (Append9); } @@ -173,66 +173,66 @@ namespace test { void check_splice () { - typedef TyOLD,Num<8>>::List OLi; + using OLi = TyOLD,Num<8>>::List; // will "paste" the list OLi "on top" of another Typelist... - typedef Splice Overl01; + using Overl01 = Splice; DISPLAY (Overl01); - typedef Splice Overl02; + using Overl02 = Splice; DISPLAY (Overl02); - typedef Splice Overl03; + using Overl03 = Splice; DISPLAY (Overl03); - typedef Splice Overl04; + using Overl04 = Splice; DISPLAY (Overl04); - typedef Splice Overl05; + using Overl05 = Splice; DISPLAY (Overl05); - typedef Splice Overl06; + using Overl06 = Splice; DISPLAY (Overl06); - typedef Splice Overl07; + using Overl07 = Splice; DISPLAY (Overl07); - typedef Splice Overl08; + using Overl08 = Splice; DISPLAY (Overl08); - typedef Splice Overl09; + using Overl09 = Splice; DISPLAY (Overl09); - typedef Splice Overl10; + using Overl10 = Splice; DISPLAY (Overl10); - typedef Splice Overl11; + using Overl11 = Splice; DISPLAY (Overl11); - typedef Splice Overl12; + using Overl12 = Splice; DISPLAY (Overl12); - typedef Splice Overl13; + using Overl13 = Splice; DISPLAY (Overl13); - typedef TyOLD>::List OLi2; - typedef Splice::Front Front1; - typedef Splice::Front Front2; - typedef Splice::Front Front3; + using OLi2 = TyOLD>::List; + using Front1 = Splice::Front; + using Front2 = Splice::Front; + using Front3 = Splice::Front; DISPLAY (Front1); DISPLAY (Front2); DISPLAY (Front3); - typedef Splice::Back Back1; - typedef Splice::Back Back2; - typedef Splice::Back Back3; + using Back1 = Splice::Back; + using Back2 = Splice::Back; + using Back3 = Splice::Back; DISPLAY (Back1); DISPLAY (Back2); DISPLAY (Back3); // Note: with a Null-Overlay, this can be used to extract arbitrary sublists: - typedef Splice::Front Front4; - typedef Splice::Back Back4; + using Front4 = Splice::Front; + using Back4 = Splice::Back; DISPLAY (Front4); DISPLAY (Back4); } @@ -241,25 +241,25 @@ namespace test { void check_s_last() { - typedef SplitLast::Type Elm; - typedef SplitLast::List Prefix; + using Elm = SplitLast::Type; + using Prefix = SplitLast::List; - typedef TyOLD::List ElmL; + using ElmL = TyOLD::List; DISPLAY (Prefix); DISPLAY (ElmL); - typedef SplitLast::Type Elm1; - typedef SplitLast::List NPrefix; + using Elm1 = SplitLast::Type; + using NPrefix = SplitLast::List; DISPLAY (NPrefix); DISPLAY (TyOLD); - typedef SplitLast::Type Nil; - typedef SplitLast::List NList; + using NilSplit = SplitLast::Type; + using NList = SplitLast::List; DISPLAY (NList); - DISPLAY (TyOLD); + DISPLAY (TyOLD); } @@ -269,16 +269,16 @@ namespace test { typedef Append::List LL; DISPLAY (LL); - typedef Dissect::List List; DISPLAY(List); - typedef Dissect::First First; DISPLAY(First); - typedef Dissect::Tail Tail; DISPLAY(Tail); - typedef Dissect::Prefix Prefix; DISPLAY(Prefix); - typedef Dissect::Last Last; DISPLAY(Last); + using List = Dissect::List; DISPLAY(List); + using First = Dissect::First; DISPLAY(First); + using Tail = Dissect::Tail; DISPLAY(Tail); + using Prefix = Dissect::Prefix; DISPLAY(Prefix); + using Last = Dissect::Last; DISPLAY(Last); - typedef Dissect::Head Head; - typedef Dissect::End End; + using Head = Dissect::Head; + using End = Dissect::End; - typedef TyOLD HeadEnd; DISPLAY(HeadEnd); + using HeadEnd = TyOLD; DISPLAY(HeadEnd); } @@ -290,7 +290,7 @@ namespace test { void check_apply () { - typedef Apply Added2; + using Added2 = Apply; DISPLAY (Added2); } @@ -301,7 +301,7 @@ namespace test { void check_filter () { - typedef Filter::List, IsEven > FilterEven; + using FilterEven = Filter::List, IsEven >; DISPLAY (FilterEven); } @@ -309,23 +309,23 @@ namespace test { void check_prefix () { - typedef PrefixAll,Num<22>> Prefix1; + using Prefix1 = PrefixAll,Num<22>>; DISPLAY (Prefix1); - typedef PrefixAll,List1> Prefix2; + using Prefix2 = PrefixAll,List1>; DISPLAY (Prefix2); - typedef PrefixAll Prefix3; + using Prefix3 = PrefixAll; DISPLAY (Prefix3); - typedef TyOLD,List2::List>::List List_of_Lists; - typedef PrefixAll,List_of_Lists> Prefix4; + using List_of_Lists = TyOLD,List2::List>::List; + using Prefix4 = PrefixAll, List_of_Lists>; DISPLAY (Prefix4); - typedef PrefixAll Prefix5; + using Prefix5 = PrefixAll; DISPLAY (Prefix5); - typedef PrefixAll Prefix6; + using Prefix6 = PrefixAll; DISPLAY (Prefix6); } @@ -333,17 +333,17 @@ namespace test { void check_distribute() { - typedef Distribute, List1> Dist1; + using Dist1 = Distribute, List1>; DISPLAY (Dist1); - typedef TyOLD,Num<22>,Num<33>>::List Prefixes; - typedef Distribute> Dist2; + using Prefixes = TyOLD,Num<22>,Num<33>>::List; + using Dist2 = Distribute>; DISPLAY (Dist2); - typedef Distribute Dist3; + using Dist3 = Distribute; DISPLAY (Dist3); - typedef Distribute::List> Dist4; + using Dist4 = Distribute::List>; DISPLAY (Dist4); } @@ -351,17 +351,16 @@ namespace test { void check_combine() { - typedef CountDown> Down; + using Down = CountDown>; DISPLAY (Down); - typedef Combine Combi; + using Combi = Combine; DISPLAY (Combi); - typedef CombineFlags OnOff; + using OnOff = CombineFlags; DISPLAY (OnOff); } - }; diff --git a/tests/library/meta/typeseq-manip-test.cpp b/tests/library/meta/typeseq-manip-test.cpp index b32dd37e3..a2902a739 100644 --- a/tests/library/meta/typeseq-manip-test.cpp +++ b/tests/library/meta/typeseq-manip-test.cpp @@ -96,15 +96,15 @@ namespace test { void check_buildSeq () { - typedef Append::List LL; + using LL = Append::List; DISPLAY (LL); - typedef TyOLD::Seq Seq; - typedef Seq::List SeqList; + using Seq = TyOLD::Seq; + using SeqList = Seq::List; DISPLAY (Seq); DISPLAY (SeqList); - typedef TyOLD::Seq NulS; + using NulS = TyOLD::Seq; DISPLAY (NulS); } @@ -112,16 +112,16 @@ namespace test { void check_prepend () { - typedef Prepend, Types1> Prepend1; + using Prepend1 = Prepend, Types1 >; DISPLAY(Prepend1); - typedef Prepend Prepend2; + using Prepend2 = Prepend; DISPLAY(Prepend2); - typedef Prepend, TyOLD<> > Prepend3; + using Prepend3 = Prepend, TyOLD<>>; DISPLAY(Prepend3); - typedef Prepend > Prepend4; + using Prepend4 = Prepend>; DISPLAY(Prepend4); } @@ -129,44 +129,44 @@ namespace test { void check_shift () { - typedef Append::List LL; - typedef TyOLD::Seq Seq; + using LL = Append::List; + using Seq = TyOLD::Seq; - typedef Shifted::Type Seq_0; DISPLAY (Seq_0); - typedef Shifted::Type Seq_1; DISPLAY (Seq_1); - typedef Shifted::Type Seq_2; DISPLAY (Seq_2); - typedef Shifted::Type Seq_3; DISPLAY (Seq_3); - typedef Shifted::Type Seq_4; DISPLAY (Seq_4); - typedef Shifted::Type Seq_5; DISPLAY (Seq_5); - typedef Shifted::Type Seq_6; DISPLAY (Seq_6); + using Seq_0 = Shifted::Type; DISPLAY (Seq_0); + using Seq_1 = Shifted::Type; DISPLAY (Seq_1); + using Seq_2 = Shifted::Type; DISPLAY (Seq_2); + using Seq_3 = Shifted::Type; DISPLAY (Seq_3); + using Seq_4 = Shifted::Type; DISPLAY (Seq_4); + using Seq_5 = Shifted::Type; DISPLAY (Seq_5); + using Seq_6 = Shifted::Type; DISPLAY (Seq_6); - typedef TyOLD::Head> Head_0; DISPLAY (Head_0); - typedef TyOLD::Head> Head_1; DISPLAY (Head_1); - typedef TyOLD::Head> Head_2; DISPLAY (Head_2); - typedef TyOLD::Head> Head_3; DISPLAY (Head_3); - typedef TyOLD::Head> Head_4; DISPLAY (Head_4); - typedef TyOLD::Head> Head_5; DISPLAY (Head_5); - typedef TyOLD::Head> Head_6; DISPLAY (Head_6); + using Head_0 = TyOLD::Head>; DISPLAY (Head_0); + using Head_1 = TyOLD::Head>; DISPLAY (Head_1); + using Head_2 = TyOLD::Head>; DISPLAY (Head_2); + using Head_3 = TyOLD::Head>; DISPLAY (Head_3); + using Head_4 = TyOLD::Head>; DISPLAY (Head_4); + using Head_5 = TyOLD::Head>; DISPLAY (Head_5); + using Head_6 = TyOLD::Head>; DISPLAY (Head_6); } void check_split () { - typedef Append::List LL; - typedef TyOLD::Seq Seq; + using LL = Append::List; + using Seq = TyOLD::Seq; DISPLAY (Seq); - typedef Split::List List; DISPLAY(List); - typedef Split::First First; DISPLAY(First); - typedef Split::Tail Tail; DISPLAY(Tail); - typedef Split::Prefix Prefix; DISPLAY(Prefix); - typedef Split::Last Last; DISPLAY(Last); + using List = Split::List; DISPLAY(List); + using First = Split::First; DISPLAY(First); + using Tail = Split::Tail; DISPLAY(Tail); + using Prefix = Split::Prefix; DISPLAY(Prefix); + using Last = Split::Last; DISPLAY(Last); - typedef Split::Head Head; - typedef Split::End End; + using Head = Split::Head; + using End = Split::End; - typedef TyOLD HeadEnd; DISPLAY(HeadEnd); + using HeadEnd = TyOLD; DISPLAY(HeadEnd); } diff --git a/tests/library/parse-test.cpp b/tests/library/parse-test.cpp index a4d33ba8d..5c5a73d00 100644 --- a/tests/library/parse-test.cpp +++ b/tests/library/parse-test.cpp @@ -727,13 +727,13 @@ namespace test { auto quoted = accept_repeated(accept(nonQuot).alt(escape)); auto quote = accept_bracket("\"\"", quoted); - auto paren = expectResult(); + auto paren = expectResult(); auto nonParen = accept(R"_([^\\\(\)"]+)_"); auto parenCont = accept_repeated(accept(nonParen) .alt(escape) .alt(quote) .alt(paren)); - paren = accept_bracket("()", parenCont).bind([](auto){ return NullType{}; }); + paren = accept_bracket("()", parenCont).bind([](auto){ return Nil{}; }); auto spec = accept_repeated(accept(content) .alt(escape) diff --git a/tests/vault/gear/activity-detector.hpp b/tests/vault/gear/activity-detector.hpp index 74591a546..e36fa97f9 100644 --- a/tests/vault/gear/activity-detector.hpp +++ b/tests/vault/gear/activity-detector.hpp @@ -294,7 +294,7 @@ namespace test { { using Ret = typename lib::meta::_Fun::Ret; using Args = typename lib::meta::_Fun::Args; - using ArgsX = typename lib::meta::StripNullType::Seq; ////////////////////////////////////TICKET #987 : make lib::meta::Types variadic + using ArgsX = typename lib::meta::StripNil::Seq; ////////////////////////////////////TICKET #987 : make lib::meta::Types variadic using SigTypes = typename lib::meta::Prepend::Seq; using Type = typename RebindVariadic::Type;