Upgrade: down with typename!!
Yet another chainsaw massacre. One of the most obnoxious annoyances with C++ metaprogramming is the need to insert `typename` and `template` qualifiers into most definitions, to help the compiler to cope with the syntax, which is not context-free. The recent standards adds several clarifications, so that most of these qualifiers are redundant now, at least at places where it is unambiguously clear that only a type can be given. GCC already supports most of these relaxing rules (Clang unfortunately lags way behind with support of newer language features...)
This commit is contained in:
parent
2cd3e95228
commit
20f3252892
124 changed files with 954 additions and 884 deletions
|
|
@ -171,8 +171,8 @@ namespace advice {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef vector<Entry> EntryList;
|
using EntryList = vector<Entry>;
|
||||||
typedef typename EntryList::iterator EIter;
|
using EIter = EntryList::iterator;
|
||||||
|
|
||||||
|
|
||||||
struct Cluster
|
struct Cluster
|
||||||
|
|
@ -249,7 +249,7 @@ namespace advice {
|
||||||
POA*
|
POA*
|
||||||
find_latest_solution (POA& requestElm)
|
find_latest_solution (POA& requestElm)
|
||||||
{
|
{
|
||||||
typedef typename EntryList::reverse_iterator RIter;
|
using RIter = EntryList::reverse_iterator;
|
||||||
Binding::Matcher pattern (requestElm.getMatcher());
|
Binding::Matcher pattern (requestElm.getMatcher());
|
||||||
for (RIter ii=this->elms_.rbegin();
|
for (RIter ii=this->elms_.rbegin();
|
||||||
ii!=this->elms_.rend();
|
ii!=this->elms_.rend();
|
||||||
|
|
@ -514,8 +514,8 @@ namespace advice {
|
||||||
bool
|
bool
|
||||||
Index<POA>::isValid() const
|
Index<POA>::isValid() const
|
||||||
{
|
{
|
||||||
typedef typename RTable::const_iterator RTIter;
|
using RTIter = RTable::const_iterator;
|
||||||
typedef typename PTable::const_iterator PTIter;
|
using PTIter = PTable::const_iterator;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (PTIter ii =provisionEntries_.begin();
|
for (PTIter ii =provisionEntries_.begin();
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ namespace lumiera {
|
||||||
|
|
||||||
/** The ServiceHandle automatically creates and manages the Proxy instance */
|
/** The ServiceHandle automatically creates and manages the Proxy instance */
|
||||||
template<class I, class FA>
|
template<class I, class FA>
|
||||||
using ServiceHandle = typename lib::DependInject<FA>::template ServiceInstance<Proxy<InstanceHandle<I,FA>>>;
|
using ServiceHandle = lib::DependInject<FA>::template ServiceInstance<Proxy<InstanceHandle<I,FA>>>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -538,7 +538,7 @@ namespace lumiera {
|
||||||
|
|
||||||
|
|
||||||
template<class RES>
|
template<class RES>
|
||||||
inline typename Query<RES>::Builder
|
inline Query<RES>::Builder
|
||||||
Query<RES>::build (Kind queryType)
|
Query<RES>::build (Kind queryType)
|
||||||
{
|
{
|
||||||
return Builder(defineQueryTypeID (queryType));
|
return Builder(defineQueryTypeID (queryType));
|
||||||
|
|
@ -546,7 +546,7 @@ namespace lumiera {
|
||||||
|
|
||||||
|
|
||||||
template<class RES>
|
template<class RES>
|
||||||
inline typename Query<RES>::Builder
|
inline Query<RES>::Builder
|
||||||
Query<RES>::rebuild() const
|
Query<RES>::rebuild() const
|
||||||
{
|
{
|
||||||
return Builder(this->id_, getQueryDefinition());
|
return Builder(this->id_, getQueryDefinition());
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace query {
|
||||||
|
|
||||||
/** we maintain an independent defaults registry
|
/** we maintain an independent defaults registry
|
||||||
* for every participating kind of object. */
|
* for every participating kind of object. */
|
||||||
typedef std::vector< P<TableEntry> > Table;
|
using Table = std::vector< P<TableEntry> >;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -132,7 +132,7 @@ namespace query {
|
||||||
struct Slot
|
struct Slot
|
||||||
: public TableEntry
|
: public TableEntry
|
||||||
{
|
{
|
||||||
typedef std::set<Record<TAR>> Registry;
|
using Registry = std::set<Record<TAR>>;
|
||||||
|
|
||||||
Registry registry;
|
Registry registry;
|
||||||
static size_t index; ///< where to find this Slot in every Table
|
static size_t index; ///< where to find this Slot in every Table
|
||||||
|
|
@ -194,7 +194,7 @@ namespace query {
|
||||||
class Iter
|
class Iter
|
||||||
{
|
{
|
||||||
friend class DefsRegistry;
|
friend class DefsRegistry;
|
||||||
typedef typename Slot<TAR>::Registry::iterator II;
|
using II = Slot<TAR>::Registry::iterator;
|
||||||
|
|
||||||
II p,i,e;
|
II p,i,e;
|
||||||
P<TAR> next, ptr;
|
P<TAR> next, ptr;
|
||||||
|
|
@ -251,12 +251,12 @@ namespace query {
|
||||||
{
|
{
|
||||||
P<TAR> dummy;
|
P<TAR> dummy;
|
||||||
Record<TAR> entry (query, dummy);
|
Record<TAR> entry (query, dummy);
|
||||||
typedef typename Slot<TAR>::Registry Registry;
|
using Registry = Slot<TAR>::Registry;
|
||||||
Registry& registry = Slot<TAR>::access(table_);
|
Registry& registry = Slot<TAR>::access(table_);
|
||||||
|
|
||||||
// try to get a possible direct match (same query)
|
// try to get a possible direct match (same query)
|
||||||
typename Registry::iterator pos = registry.find (entry);
|
auto pos = registry.find (entry);
|
||||||
typename Registry::iterator end = registry.end();
|
auto end = registry.end();
|
||||||
|
|
||||||
if (pos==end)
|
if (pos==end)
|
||||||
return Iter<TAR> (registry.begin(), end); // just enumerate contents
|
return Iter<TAR> (registry.begin(), end); // just enumerate contents
|
||||||
|
|
@ -277,8 +277,8 @@ namespace query {
|
||||||
put (P<TAR> const& obj, Query<TAR> const& query)
|
put (P<TAR> const& obj, Query<TAR> const& query)
|
||||||
{
|
{
|
||||||
Record<TAR> entry (query, obj);
|
Record<TAR> entry (query, obj);
|
||||||
typedef typename Slot<TAR>::Registry Registry;
|
using Registry = Slot<TAR>::Registry;
|
||||||
typedef typename Registry::iterator RIter;
|
using RIter = Registry::iterator;
|
||||||
|
|
||||||
Registry& registry = Slot<TAR>::access(table_);
|
Registry& registry = Slot<TAR>::access(table_);
|
||||||
RIter pos = registry.lower_bound (entry);
|
RIter pos = registry.lower_bound (entry);
|
||||||
|
|
@ -306,8 +306,8 @@ namespace query {
|
||||||
bool
|
bool
|
||||||
forget (P<TAR> const& obj)
|
forget (P<TAR> const& obj)
|
||||||
{
|
{
|
||||||
typedef typename Slot<TAR>::Registry Registry;
|
using Registry = Slot<TAR>::Registry;
|
||||||
typedef typename Record<TAR>::Search SearchFunc;
|
using SearchFunc = Record<TAR>::Search;
|
||||||
|
|
||||||
Registry& registry = Slot<TAR>::access(table_);
|
Registry& registry = Slot<TAR>::access(table_);
|
||||||
return util::remove_if(registry, SearchFunc (obj));
|
return util::remove_if(registry, SearchFunc (obj));
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ namespace lumiera {
|
||||||
|
|
||||||
|
|
||||||
template<typename RES>
|
template<typename RES>
|
||||||
inline typename Query<RES>::iterator
|
inline Query<RES>::iterator
|
||||||
Query<RES>::resolveBy (QueryResolver const& resolver) const
|
Query<RES>::resolveBy (QueryResolver const& resolver) const
|
||||||
{
|
{
|
||||||
PReso resultSet = resolver.issue (*this);
|
PReso resultSet = resolver.issue (*this);
|
||||||
|
|
@ -150,7 +150,7 @@ namespace lumiera {
|
||||||
/** notational convenience shortcut,
|
/** notational convenience shortcut,
|
||||||
* synonymous to Query<RES>::resolveBy() */
|
* synonymous to Query<RES>::resolveBy() */
|
||||||
template<typename RES>
|
template<typename RES>
|
||||||
inline typename Query<RES>::iterator
|
inline Query<RES>::iterator
|
||||||
Query<RES>::operator() (QueryResolver const& resolver) const
|
Query<RES>::operator() (QueryResolver const& resolver) const
|
||||||
{
|
{
|
||||||
return resolveBy (resolver);
|
return resolveBy (resolver);
|
||||||
|
|
|
||||||
|
|
@ -347,14 +347,14 @@ namespace lib {
|
||||||
struct SetupSeveral<std::void_t, lib::AllocationCluster&>
|
struct SetupSeveral<std::void_t, lib::AllocationCluster&>
|
||||||
{
|
{
|
||||||
template<typename X>
|
template<typename X>
|
||||||
using Adapter = typename AllocationCluster::template Allocator<X>;
|
using Adapter = AllocationCluster::template Allocator<X>;
|
||||||
|
|
||||||
template<class I, class E>
|
template<class I, class E>
|
||||||
struct Policy
|
struct Policy
|
||||||
: AllocationPolicy<I,E,Adapter>
|
: AllocationPolicy<I,E,Adapter>
|
||||||
{
|
{
|
||||||
using Base = AllocationPolicy<I,E,Adapter>;
|
using Base = AllocationPolicy<I,E,Adapter>;
|
||||||
using Bucket = typename Base::Bucket;
|
using Bucket = Base::Bucket;
|
||||||
|
|
||||||
/** @warning allocation size is severely limited in AllocationCluster. */
|
/** @warning allocation size is severely limited in AllocationCluster. */
|
||||||
size_t static constexpr ALLOC_LIMIT = AllocationCluster::max_size();
|
size_t static constexpr ALLOC_LIMIT = AllocationCluster::max_size();
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
using Allo = ALO;
|
using Allo = ALO;
|
||||||
using AlloT = std::allocator_traits<Allo>;
|
using AlloT = std::allocator_traits<Allo>;
|
||||||
using BaseType = typename Allo::value_type;
|
using BaseType = Allo::value_type;
|
||||||
|
|
||||||
Allo& baseAllocator() { return *this; }
|
Allo& baseAllocator() { return *this; }
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
adaptAllocator()
|
adaptAllocator()
|
||||||
{
|
{
|
||||||
using XAllo = typename AlloT::template rebind_alloc<X>;
|
using XAllo = AlloT::template rebind_alloc<X>;
|
||||||
if constexpr (std::is_constructible_v<XAllo, Allo>)
|
if constexpr (std::is_constructible_v<XAllo, Allo>)
|
||||||
return XAllo{baseAllocator()};
|
return XAllo{baseAllocator()};
|
||||||
else
|
else
|
||||||
|
|
@ -105,8 +105,8 @@ namespace lib {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ALOT, typename...ARGS>
|
template<class ALOT, typename...ARGS>
|
||||||
typename ALOT::pointer
|
ALOT::pointer
|
||||||
construct (typename ALOT::allocator_type& allo, ARGS&& ...args)
|
construct (ALOT::allocator_type& allo, ARGS&& ...args)
|
||||||
{
|
{
|
||||||
auto loc = ALOT::allocate (allo, 1);
|
auto loc = ALOT::allocate (allo, 1);
|
||||||
try { ALOT::construct (allo, loc, std::forward<ARGS>(args)...); }
|
try { ALOT::construct (allo, loc, std::forward<ARGS>(args)...); }
|
||||||
|
|
@ -120,7 +120,7 @@ namespace lib {
|
||||||
|
|
||||||
template<class ALOT>
|
template<class ALOT>
|
||||||
void
|
void
|
||||||
destroy (typename ALOT::allocator_type& allo, typename ALOT::pointer elm)
|
destroy (ALOT::allocator_type& allo, ALOT::pointer elm)
|
||||||
{
|
{
|
||||||
ALOT::destroy (allo, elm);
|
ALOT::destroy (allo, elm);
|
||||||
ALOT::deallocate (allo, elm, 1);
|
ALOT::deallocate (allo, elm, 1);
|
||||||
|
|
@ -167,7 +167,7 @@ namespace lib {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using XAlloT = typename AlloT::template rebind_traits<TY>;
|
using XAlloT = AlloT::template rebind_traits<TY>;
|
||||||
auto xAllo = adaptAllocator<TY>();
|
auto xAllo = adaptAllocator<TY>();
|
||||||
return construct<XAlloT> (xAllo, std::forward<ARGS>(args)...);
|
return construct<XAlloT> (xAllo, std::forward<ARGS>(args)...);
|
||||||
}
|
}
|
||||||
|
|
@ -184,7 +184,7 @@ namespace lib {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using XAlloT = typename AlloT::template rebind_traits<TY>;
|
using XAlloT = AlloT::template rebind_traits<TY>;
|
||||||
auto xAllo = adaptAllocator<TY>();
|
auto xAllo = adaptAllocator<TY>();
|
||||||
destroy<XAlloT> (xAllo, elm);
|
destroy<XAlloT> (xAllo, elm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,8 @@ namespace lib {
|
||||||
class DependInject
|
class DependInject
|
||||||
: util::NoInstance
|
: util::NoInstance
|
||||||
{
|
{
|
||||||
using Factory = typename Depend<SRV>::Factory;
|
using Factory = Depend<SRV>::Factory;
|
||||||
using Lock = typename Depend<SRV>::Lock;
|
using Lock = Depend<SRV>::Lock;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** configure dependency-injection for type SRV to build a subclass singleton.
|
/** configure dependency-injection for type SRV to build a subclass singleton.
|
||||||
|
|
@ -178,8 +178,8 @@ namespace lib {
|
||||||
static void
|
static void
|
||||||
useSingleton (FUN&& ctor)
|
useSingleton (FUN&& ctor)
|
||||||
{
|
{
|
||||||
using Sub = typename SubclassFactoryType<FUN>::Subclass;
|
using Sub = SubclassFactoryType<FUN>::Subclass;
|
||||||
using Fun = typename SubclassFactoryType<FUN>::Functor;
|
using Fun = SubclassFactoryType<FUN>::Functor;
|
||||||
|
|
||||||
__assert_compatible<Sub>();
|
__assert_compatible<Sub>();
|
||||||
installFactory<Sub,Fun> (forward<FUN> (ctor));
|
installFactory<Sub,Fun> (forward<FUN> (ctor));
|
||||||
|
|
@ -372,9 +372,9 @@ namespace lib {
|
||||||
static_assert (meta::_Fun<FUN>(),
|
static_assert (meta::_Fun<FUN>(),
|
||||||
"Need a Lambda or Function object to create a heap allocated instance");
|
"Need a Lambda or Function object to create a heap allocated instance");
|
||||||
|
|
||||||
using Functor = typename meta::_Fun<FUN>::Functor; // suitable type to store for later invocation
|
using Functor = meta::_Fun<FUN>::Functor; // suitable type to store for later invocation
|
||||||
using ResultVal = typename meta::_Fun<FUN>::Ret;
|
using ResultVal = meta::_Fun<FUN>::Ret;
|
||||||
using Subclass = typename meta::Strip<ResultVal>::TypePlain;
|
using Subclass = meta::Strip<ResultVal>::TypePlain;
|
||||||
|
|
||||||
static_assert (std::is_pointer<ResultVal>::value,
|
static_assert (std::is_pointer<ResultVal>::value,
|
||||||
"Function must yield a pointer to a heap allocated instance");
|
"Function must yield a pointer to a heap allocated instance");
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ namespace diff{
|
||||||
struct InterpreterScheme ///< base case is to expect typedef I::Val
|
struct InterpreterScheme ///< base case is to expect typedef I::Val
|
||||||
{
|
{
|
||||||
using Interpreter = I;
|
using Interpreter = I;
|
||||||
using Val = typename I::Val;
|
using Val = I::Val;
|
||||||
using Handler = HandlerFun<I,Val>;
|
using Handler = HandlerFun<I,Val>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -188,12 +188,12 @@ namespace diff{
|
||||||
struct DiffStepBuilder
|
struct DiffStepBuilder
|
||||||
{
|
{
|
||||||
using Scheme = InterpreterScheme<I>;
|
using Scheme = InterpreterScheme<I>;
|
||||||
using Handler = typename Scheme::Handler;
|
using Handler = Scheme::Handler;
|
||||||
using Val = typename Scheme::Val;
|
using Val = Scheme::Val;
|
||||||
|
|
||||||
using Lang = DiffLanguage<I,Val>;
|
using Lang = DiffLanguage<I,Val>;
|
||||||
using Step = typename Lang::DiffStep;
|
using Step = Lang::DiffStep;
|
||||||
using Verb = typename Lang::DiffVerb;
|
using Verb = Lang::DiffVerb;
|
||||||
|
|
||||||
Handler handler;
|
Handler handler;
|
||||||
Literal id;
|
Literal id;
|
||||||
|
|
@ -239,7 +239,7 @@ namespace diff{
|
||||||
* @warning use for internal state marking only --
|
* @warning use for internal state marking only --
|
||||||
* invoking this token produces undefined behaviour */
|
* invoking this token produces undefined behaviour */
|
||||||
template<class I, typename E>
|
template<class I, typename E>
|
||||||
const typename DiffLanguage<I,E>::DiffStep DiffLanguage<I,E>::NIL = DiffStep(DiffVerb(), E());
|
const DiffLanguage<I,E>::DiffStep DiffLanguage<I,E>::NIL = DiffStep(DiffVerb(), E());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ namespace diff{
|
||||||
struct RecordSetup<GenNode>
|
struct RecordSetup<GenNode>
|
||||||
{
|
{
|
||||||
using Storage = std::vector<GenNode>;
|
using Storage = std::vector<GenNode>;
|
||||||
using ElmIter = typename Storage::const_iterator;
|
using ElmIter = Storage::const_iterator;
|
||||||
|
|
||||||
/** using const reference data access
|
/** using const reference data access
|
||||||
* relevant for handling large subtrees */
|
* relevant for handling large subtrees */
|
||||||
|
|
@ -516,7 +516,7 @@ namespace diff{
|
||||||
using No = lib::meta::No_t;
|
using No = lib::meta::No_t;
|
||||||
|
|
||||||
template<class X>
|
template<class X>
|
||||||
static Yes check(typename variant::CanBuildFrom<X, DataValues>::Type*);
|
static Yes check(variant::CanBuildFrom<X, DataValues>::Type*);
|
||||||
template<class X>
|
template<class X>
|
||||||
static No check(...);
|
static No check(...);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ namespace diff{
|
||||||
|
|
||||||
/* === forwarded sequence access === */
|
/* === forwarded sequence access === */
|
||||||
|
|
||||||
using iterator = typename std::vector<VAL>::iterator;
|
using iterator = std::vector<VAL>::iterator;
|
||||||
using const_iterator = typename std::vector<VAL>::const_iterator;
|
using const_iterator = std::vector<VAL>::const_iterator;
|
||||||
|
|
||||||
iterator begin() { return data_.begin(); }
|
iterator begin() { return data_.begin(); }
|
||||||
iterator end() { return data_.end(); }
|
iterator end() { return data_.end(); }
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace diff{
|
||||||
: public ListDiffInterpreter<E>
|
: public ListDiffInterpreter<E>
|
||||||
{
|
{
|
||||||
using Vec = vector<E,ARGS...>;
|
using Vec = vector<E,ARGS...>;
|
||||||
using Iter = typename Vec::iterator;
|
using Iter = Vec::iterator;
|
||||||
|
|
||||||
Vec orig_;
|
Vec orig_;
|
||||||
Vec& seq_;
|
Vec& seq_;
|
||||||
|
|
|
||||||
|
|
@ -78,14 +78,14 @@ namespace diff{
|
||||||
class DiffDetector
|
class DiffDetector
|
||||||
: util::NonCopyable
|
: util::NonCopyable
|
||||||
{
|
{
|
||||||
using Val = typename SEQ::value_type;
|
using Val = SEQ::value_type;
|
||||||
using Idx = IndexTable<Val>;
|
using Idx = IndexTable<Val>;
|
||||||
|
|
||||||
Idx refIdx_;
|
Idx refIdx_;
|
||||||
SEQ const& currentData_;
|
SEQ const& currentData_;
|
||||||
|
|
||||||
|
|
||||||
using DiffStep = typename ListDiffLanguage<Val>::DiffStep;
|
using DiffStep = ListDiffLanguage<Val>::DiffStep;
|
||||||
|
|
||||||
/** @internal state frame for diff detection and generation. */
|
/** @internal state frame for diff detection and generation. */
|
||||||
class DiffFrame;
|
class DiffFrame;
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ namespace diff{
|
||||||
template<typename VAL>
|
template<typename VAL>
|
||||||
class Record
|
class Record
|
||||||
{
|
{
|
||||||
using Storage = typename RecordSetup<VAL>::Storage;
|
using Storage = RecordSetup<VAL>::Storage;
|
||||||
using ElmIter = typename RecordSetup<VAL>::ElmIter;
|
using ElmIter = RecordSetup<VAL>::ElmIter;
|
||||||
using Access = typename RecordSetup<VAL>::Access;
|
using Access = RecordSetup<VAL>::Access;
|
||||||
|
|
||||||
|
|
||||||
string type_;
|
string type_;
|
||||||
|
|
@ -307,7 +307,7 @@ namespace diff{
|
||||||
/* ==== Exposing scope and contents for iteration ====== */
|
/* ==== Exposing scope and contents for iteration ====== */
|
||||||
|
|
||||||
using iterator = IterAdapter<ElmIter, const Record*>;
|
using iterator = IterAdapter<ElmIter, const Record*>;
|
||||||
using scopeIter = typename iter_stl::_SeqT<const Storage>::Range;
|
using scopeIter = iter_stl::_SeqT<const Storage>::Range;
|
||||||
using keyIter = TransformIter<scopeIter, string>;
|
using keyIter = TransformIter<scopeIter, string>;
|
||||||
using valIter = TransformIter<scopeIter, Access>;
|
using valIter = TransformIter<scopeIter, Access>;
|
||||||
|
|
||||||
|
|
@ -595,10 +595,10 @@ namespace diff{
|
||||||
* @see tree-diff-application.hpp
|
* @see tree-diff-application.hpp
|
||||||
*/
|
*/
|
||||||
template<typename VAL>
|
template<typename VAL>
|
||||||
inline typename Record<VAL>::Mutator&
|
inline Record<VAL>::Mutator&
|
||||||
mutateInPlace (Record<VAL>& record_to_mutate)
|
mutateInPlace (Record<VAL>& record_to_mutate)
|
||||||
{
|
{
|
||||||
return reinterpret_cast<typename Record<VAL>::Mutator &> (record_to_mutate);
|
return reinterpret_cast<Record<VAL>::Mutator &> (record_to_mutate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -713,7 +713,7 @@ namespace diff{
|
||||||
struct RecordSetup<string>
|
struct RecordSetup<string>
|
||||||
{
|
{
|
||||||
using Storage = std::vector<string>;
|
using Storage = std::vector<string>;
|
||||||
using ElmIter = typename Storage::const_iterator;
|
using ElmIter = Storage::const_iterator;
|
||||||
using Access = string; ///< data access by value copy
|
using Access = string; ///< data access by value copy
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -195,8 +195,8 @@ namespace diff{
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using iterator = typename iter_stl::_SeqT<VecG>::Range;
|
using iterator = iter_stl::_SeqT<VecG>::Range;
|
||||||
using const_iterator = typename iter_stl::_SeqT<const VecG>::Range;
|
using const_iterator = iter_stl::_SeqT<const VecG>::Range;
|
||||||
|
|
||||||
const_iterator begin() const { return eachElm(content_); }
|
const_iterator begin() const { return eachElm(content_); }
|
||||||
const_iterator end() const { return const_iterator(); }
|
const_iterator end() const { return const_iterator(); }
|
||||||
|
|
|
||||||
|
|
@ -364,7 +364,7 @@ namespace diff{
|
||||||
void
|
void
|
||||||
initDiffApplication()
|
initDiffApplication()
|
||||||
{
|
{
|
||||||
using Target = typename TreeDiffTraits<TAR>::Ret;
|
using Target = TreeDiffTraits<TAR>::Ret;
|
||||||
|
|
||||||
Target target = mutatorBinding (subject_);
|
Target target = mutatorBinding (subject_);
|
||||||
buildMutator(target)->init();
|
buildMutator(target)->init();
|
||||||
|
|
|
||||||
|
|
@ -200,10 +200,10 @@ namespace diff{
|
||||||
* the return value in local scope as long as necessary
|
* the return value in local scope as long as necessary
|
||||||
*/
|
*/
|
||||||
template<class TAR>
|
template<class TAR>
|
||||||
typename TreeDiffTraits<TAR>::Ret
|
TreeDiffTraits<TAR>::Ret
|
||||||
mutatorBinding (TAR& subject)
|
mutatorBinding (TAR& subject)
|
||||||
{
|
{
|
||||||
using Wrapper = typename TreeDiffTraits<TAR>::Ret;
|
using Wrapper = TreeDiffTraits<TAR>::Ret;
|
||||||
return Wrapper(subject);
|
return Wrapper(subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,8 +236,8 @@ namespace diff{
|
||||||
class ChangeOperation
|
class ChangeOperation
|
||||||
: public AttributeBindingBase<PAR>
|
: public AttributeBindingBase<PAR>
|
||||||
{
|
{
|
||||||
using CloArgs = typename lib::meta::_Fun<CLO>::Args;
|
using CloArgs = lib::meta::_Fun<CLO>::Args;
|
||||||
using ValueType = typename lib::meta::Pick<CloArgs, 0>::Type;
|
using ValueType = lib::meta::Pick<CloArgs, 0>::Type;
|
||||||
using ID = idi::EntryID<ValueType>;
|
using ID = idi::EntryID<ValueType>;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,8 @@ namespace diff{
|
||||||
struct ContainerTraits<V, IF_is_vector<V> >
|
struct ContainerTraits<V, IF_is_vector<V> >
|
||||||
{
|
{
|
||||||
using Vec = _AsVector<V>;
|
using Vec = _AsVector<V>;
|
||||||
using Elm = typename Vec::value_type;
|
using Elm = Vec::value_type;
|
||||||
using Itr = typename Vec::iterator;
|
using Itr = Vec::iterator;
|
||||||
|
|
||||||
static Itr
|
static Itr
|
||||||
recentElmRawIter (Vec& vec)
|
recentElmRawIter (Vec& vec)
|
||||||
|
|
@ -141,8 +141,8 @@ namespace diff{
|
||||||
struct ContainerTraits<M, IF_is_map<M> >
|
struct ContainerTraits<M, IF_is_map<M> >
|
||||||
{
|
{
|
||||||
using Map = _AsMap<M>;
|
using Map = _AsMap<M>;
|
||||||
using Key = typename Map::key_type;
|
using Key = Map::key_type;
|
||||||
using Val = typename Map::mapped_type;
|
using Val = Map::mapped_type;
|
||||||
using Elm = std::pair<const Key, Val>;
|
using Elm = std::pair<const Key, Val>;
|
||||||
|
|
||||||
/** heuristic for `std::map`: lookup via reverse iterator.
|
/** heuristic for `std::map`: lookup via reverse iterator.
|
||||||
|
|
@ -188,12 +188,12 @@ namespace diff{
|
||||||
struct CollectionBinding
|
struct CollectionBinding
|
||||||
: util::MoveOnly
|
: util::MoveOnly
|
||||||
{
|
{
|
||||||
using Coll = typename Strip<COLL>::TypeReferred;
|
using Coll = Strip<COLL>::TypeReferred;
|
||||||
using Elm = typename Coll::value_type;
|
using Elm = Coll::value_type;
|
||||||
using Trait = ContainerTraits<Coll>;
|
using Trait = ContainerTraits<Coll>;
|
||||||
|
|
||||||
using iterator = typename lib::iter_stl::_SeqT<Coll>::Range;
|
using iterator = lib::iter_stl::_SeqT<Coll>::Range;
|
||||||
using const_iterator = typename lib::iter_stl::_SeqT<const Coll>::Range;
|
using const_iterator = lib::iter_stl::_SeqT<const Coll>::Range;
|
||||||
|
|
||||||
|
|
||||||
ASSERT_VALID_SIGNATURE (MAT, bool(GenNode const& spec, Elm const& elm))
|
ASSERT_VALID_SIGNATURE (MAT, bool(GenNode const& spec, Elm const& elm))
|
||||||
|
|
@ -306,7 +306,7 @@ namespace diff{
|
||||||
class ChildCollectionMutator
|
class ChildCollectionMutator
|
||||||
: public PAR
|
: public PAR
|
||||||
{
|
{
|
||||||
using Iter = typename BIN::iterator;
|
using Iter = BIN::iterator;
|
||||||
|
|
||||||
BIN binding_;
|
BIN binding_;
|
||||||
Iter pos_;
|
Iter pos_;
|
||||||
|
|
@ -582,7 +582,7 @@ namespace diff{
|
||||||
inline auto
|
inline auto
|
||||||
createCollectionBindingBuilder (COLL& coll, MAT m, CTR c, SEL s, ASS a, MUT u)
|
createCollectionBindingBuilder (COLL& coll, MAT m, CTR c, SEL s, ASS a, MUT u)
|
||||||
{
|
{
|
||||||
using Coll = typename Strip<COLL>::TypeReferred;
|
using Coll = Strip<COLL>::TypeReferred;
|
||||||
|
|
||||||
return CollectionBindingBuilder<Coll, MAT,CTR,SEL,ASS,MUT> {coll, m,c,s,a,u};
|
return CollectionBindingBuilder<Coll, MAT,CTR,SEL,ASS,MUT> {coll, m,c,s,a,u};
|
||||||
}
|
}
|
||||||
|
|
@ -738,7 +738,7 @@ namespace diff{
|
||||||
inline auto
|
inline auto
|
||||||
collection (COLL& coll)
|
collection (COLL& coll)
|
||||||
{
|
{
|
||||||
using Elm = typename COLL::value_type;
|
using Elm = COLL::value_type;
|
||||||
|
|
||||||
return _DefaultBinding<Elm>::attachTo(coll);
|
return _DefaultBinding<Elm>::attachTo(coll);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,8 @@ namespace lib {
|
||||||
: public std::vector<P<ELM>>
|
: public std::vector<P<ELM>>
|
||||||
{
|
{
|
||||||
using _Vec = std::vector<P<ELM>>;
|
using _Vec = std::vector<P<ELM>>;
|
||||||
using Iter = typename _Vec::iterator;
|
using Iter = _Vec::iterator;
|
||||||
using CIter = typename _Vec::const_iterator;
|
using CIter = _Vec::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~ElementTracker()
|
~ElementTracker()
|
||||||
|
|
@ -226,7 +226,7 @@ namespace lib {
|
||||||
/** storage for the functor to link an AutoRegistered entity
|
/** storage for the functor to link an AutoRegistered entity
|
||||||
* to the corresponding registration service */
|
* to the corresponding registration service */
|
||||||
template<typename TAR>
|
template<typename TAR>
|
||||||
typename AutoRegistered<TAR>::RegistryLink AutoRegistered<TAR>::getRegistry;
|
AutoRegistered<TAR>::RegistryLink AutoRegistered<TAR>::getRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ namespace util {
|
||||||
inline std::string
|
inline std::string
|
||||||
toString (TY const& val) noexcept
|
toString (TY const& val) noexcept
|
||||||
{
|
{
|
||||||
using PlainVal = typename lib::meta::Strip<TY>::TypeReferred;
|
using PlainVal = lib::meta::Strip<TY>::TypeReferred;
|
||||||
return StringConv<PlainVal>::invoke (val);
|
return StringConv<PlainVal>::invoke (val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
stringify (IT&& src)
|
stringify (IT&& src)
|
||||||
{
|
{
|
||||||
using Val = typename lib::meta::ValueTypeBinding<IT>::value_type;
|
using Val = lib::meta::ValueTypeBinding<IT>::value_type;
|
||||||
|
|
||||||
return lib::transformIterator(forward<IT>(src), util::toString<Val>);
|
return lib::transformIterator(forward<IT>(src), util::toString<Val>);
|
||||||
}
|
}
|
||||||
|
|
@ -144,7 +144,7 @@ namespace util {
|
||||||
template<class CON, typename TOGGLE = void>
|
template<class CON, typename TOGGLE = void>
|
||||||
struct _RangeIter
|
struct _RangeIter
|
||||||
{
|
{
|
||||||
using StlIter = typename CON::const_iterator;
|
using StlIter = CON::const_iterator;
|
||||||
|
|
||||||
lib::RangeIter<StlIter> iter;
|
lib::RangeIter<StlIter> iter;
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ namespace util {
|
||||||
inline string
|
inline string
|
||||||
join (COLL&& coll, string const& delim =", ")
|
join (COLL&& coll, string const& delim =", ")
|
||||||
{
|
{
|
||||||
using Coll = typename lib::meta::Strip<COLL>::TypePlain;
|
using Coll = lib::meta::Strip<COLL>::TypePlain;
|
||||||
_RangeIter<Coll> range(std::forward<COLL>(coll)); // copies when CON is reference
|
_RangeIter<Coll> range(std::forward<COLL>(coll)); // copies when CON is reference
|
||||||
|
|
||||||
auto strings = stringify (std::move (range.iter));
|
auto strings = stringify (std::move (range.iter));
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ namespace lib {
|
||||||
|
|
||||||
/** access type to reside in the given slot of the _complete chain_ */
|
/** access type to reside in the given slot of the _complete chain_ */
|
||||||
template<size_t slot>
|
template<size_t slot>
|
||||||
using Elm_t = typename PickType<slot>::type;
|
using Elm_t = PickType<slot>::type;
|
||||||
|
|
||||||
|
|
||||||
/** access data elements within _complete chain_ by index pos */
|
/** access data elements within _complete chain_ by index pos */
|
||||||
|
|
@ -272,10 +272,10 @@ namespace lib {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename...XVALS>
|
template<typename...XVALS>
|
||||||
using ChainExtent = typename ChainType::template Chain<XVALS...>;
|
using ChainExtent = ChainType::template Chain<XVALS...>;
|
||||||
|
|
||||||
template<size_t slot>
|
template<size_t slot>
|
||||||
using Accessor = typename ChainType::template Accessor<_Self::size()+slot>;
|
using Accessor = ChainType::template Accessor<_Self::size()+slot>;
|
||||||
|
|
||||||
template<typename X>
|
template<typename X>
|
||||||
using AccessorFor = Accessor<meta::indexOfType<X,VALS...>()>;
|
using AccessorFor = Accessor<meta::indexOfType<X,VALS...>()>;
|
||||||
|
|
@ -310,7 +310,7 @@ namespace lib {
|
||||||
using _FrontBlock = HeteroData<meta::Node<StorageFrame<0, DATA...>, meta::Nil>>;
|
using _FrontBlock = HeteroData<meta::Node<StorageFrame<0, DATA...>, meta::Nil>>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using NewFrame = typename _FrontBlock::Frame;
|
using NewFrame = _FrontBlock::Frame;
|
||||||
using ChainType = _FrontBlock;
|
using ChainType = _FrontBlock;
|
||||||
using _FrontBlock::_FrontBlock;
|
using _FrontBlock::_FrontBlock;
|
||||||
|
|
||||||
|
|
@ -434,7 +434,7 @@ namespace std { // Specialisation to support C++ »Tuple Protocol« and structur
|
||||||
template<size_t I, typename...DATA>
|
template<size_t I, typename...DATA>
|
||||||
struct tuple_element<I, lib::HeteroData<DATA...> >
|
struct tuple_element<I, lib::HeteroData<DATA...> >
|
||||||
{
|
{
|
||||||
using type = typename lib::HeteroData<DATA...>::template Elm_t<I>;
|
using type = lib::HeteroData<DATA...>::template Elm_t<I>;
|
||||||
};
|
};
|
||||||
template<size_t I>
|
template<size_t I>
|
||||||
struct tuple_element<I, lib::HeteroData<lib::meta::Nil> >
|
struct tuple_element<I, lib::HeteroData<lib::meta::Nil> >
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ namespace lib {
|
||||||
|
|
||||||
using ResVal = decltype(data_->operator[](0));
|
using ResVal = decltype(data_->operator[](0));
|
||||||
|
|
||||||
using value_type = typename meta::RefTraits<ResVal>::Value;
|
using value_type = meta::RefTraits<ResVal>::Value;
|
||||||
using reference = typename meta::RefTraits<ResVal>::Reference;
|
using reference = meta::RefTraits<ResVal>::Reference;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
checkPoint() const
|
checkPoint() const
|
||||||
|
|
@ -113,7 +113,7 @@ namespace lib {
|
||||||
: public iter::IndexAccessCore<PTR>::IterWrapper
|
: public iter::IndexAccessCore<PTR>::IterWrapper
|
||||||
{
|
{
|
||||||
using _Cor = iter::IndexAccessCore<PTR>;
|
using _Cor = iter::IndexAccessCore<PTR>;
|
||||||
using _Par = typename _Cor::IterWrapper;
|
using _Par = _Cor::IterWrapper;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IndexIter() = default;
|
IndexIter() = default;
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,10 @@ namespace lib {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** this iterator adapter is meant to wrap an iterator yielding pointer values */
|
/** this iterator adapter is meant to wrap an iterator yielding pointer values */
|
||||||
using pointer = typename meta::ValueTypeBinding<IT>::value_type;
|
using pointer = meta::ValueTypeBinding<IT>::value_type;
|
||||||
static_assert(std::is_pointer_v<pointer>);
|
static_assert(std::is_pointer_v<pointer>);
|
||||||
|
|
||||||
using value_type = typename std::remove_pointer_t<pointer>;
|
using value_type = std::remove_pointer_t<pointer>;
|
||||||
using reference = value_type&;
|
using reference = value_type&;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -72,10 +72,10 @@ namespace lib {
|
||||||
|
|
||||||
// the purpose of the following typedefs is to support building a correct "const iterator"
|
// the purpose of the following typedefs is to support building a correct "const iterator"
|
||||||
|
|
||||||
using ValueTypeBase = typename std::remove_const_t<value_type>; // value_type without const
|
using ValueTypeBase = std::remove_const_t<value_type>; // value_type without const
|
||||||
|
|
||||||
using WrappedIterType = typename IterType<IT>::template SimilarIter< ValueTypeBase* * >::Type;
|
using WrappedIterType = IterType<IT>::template SimilarIter< ValueTypeBase* * >::Type;
|
||||||
using WrappedConstIterType = typename IterType<IT>::template SimilarIter<const ValueTypeBase* * >::Type;
|
using WrappedConstIterType = IterType<IT>::template SimilarIter<const ValueTypeBase* * >::Type;
|
||||||
|
|
||||||
using IterType = PtrDerefIter<WrappedIterType>;
|
using IterType = PtrDerefIter<WrappedIterType>;
|
||||||
using ConstIterType = PtrDerefIter<WrappedConstIterType>;
|
using ConstIterType = PtrDerefIter<WrappedConstIterType>;
|
||||||
|
|
@ -220,7 +220,7 @@ namespace lib {
|
||||||
template<class IT>
|
template<class IT>
|
||||||
class AddressExposingIter
|
class AddressExposingIter
|
||||||
{
|
{
|
||||||
using _Ptr = typename IT::pointer;
|
using _Ptr = IT::pointer;
|
||||||
|
|
||||||
IT i_; ///< nested source iterator
|
IT i_; ///< nested source iterator
|
||||||
|
|
||||||
|
|
@ -238,9 +238,9 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using pointer = typename IT::pointer const*;
|
using pointer = IT::pointer const*;
|
||||||
using reference = typename IT::pointer const&;
|
using reference = IT::pointer const&;
|
||||||
using value_type = typename IT::pointer const ;
|
using value_type = IT::pointer const ;
|
||||||
|
|
||||||
ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (AddressExposingIter);
|
ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (AddressExposingIter);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,9 @@ namespace iter_stl {
|
||||||
class DistinctIter
|
class DistinctIter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using value_type = typename IT::value_type;
|
using value_type = IT::value_type;
|
||||||
using reference = typename IT::reference;
|
using reference = IT::reference;
|
||||||
using pointer = typename IT::pointer;
|
using pointer = IT::pointer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IT i_;
|
IT i_;
|
||||||
|
|
@ -96,9 +96,9 @@ namespace iter_stl {
|
||||||
template<typename DEF>
|
template<typename DEF>
|
||||||
struct WrappedStlIter : DEF
|
struct WrappedStlIter : DEF
|
||||||
{
|
{
|
||||||
using Iter = typename DEF::Iter;
|
using Iter = DEF::Iter;
|
||||||
using reference = typename DEF::reference;
|
using reference = DEF::reference;
|
||||||
using pointer = typename DEF::pointer;
|
using pointer = DEF::pointer;
|
||||||
|
|
||||||
|
|
||||||
WrappedStlIter() : i_() { }
|
WrappedStlIter() : i_() { }
|
||||||
|
|
@ -127,9 +127,9 @@ namespace iter_stl {
|
||||||
struct Wrapped_Identity
|
struct Wrapped_Identity
|
||||||
{
|
{
|
||||||
using Iter = IT;
|
using Iter = IT;
|
||||||
using value_type = typename IT::value_type;
|
using value_type = IT::value_type;
|
||||||
using reference = typename IT::reference;
|
using reference = IT::reference;
|
||||||
using pointer = typename IT::pointer;
|
using pointer = IT::pointer;
|
||||||
|
|
||||||
static Iter get (Iter& it) { return & (*it); }
|
static Iter get (Iter& it) { return & (*it); }
|
||||||
};
|
};
|
||||||
|
|
@ -142,7 +142,7 @@ namespace iter_stl {
|
||||||
struct Wrapped_PickKey
|
struct Wrapped_PickKey
|
||||||
{
|
{
|
||||||
using Iter = IT;
|
using Iter = IT;
|
||||||
using value_type = typename IT::value_type::first_type;
|
using value_type = IT::value_type::first_type;
|
||||||
using reference = value_type &;
|
using reference = value_type &;
|
||||||
using pointer = value_type *;
|
using pointer = value_type *;
|
||||||
|
|
||||||
|
|
@ -157,7 +157,7 @@ namespace iter_stl {
|
||||||
struct Wrapped_PickVal
|
struct Wrapped_PickVal
|
||||||
{
|
{
|
||||||
using Iter = IT;
|
using Iter = IT;
|
||||||
using value_type = typename IT::value_type::second_type;
|
using value_type = IT::value_type::second_type;
|
||||||
using reference = value_type &;
|
using reference = value_type &;
|
||||||
using pointer = value_type *;
|
using pointer = value_type *;
|
||||||
|
|
||||||
|
|
@ -168,7 +168,7 @@ namespace iter_stl {
|
||||||
struct Wrapped_PickConstVal
|
struct Wrapped_PickConstVal
|
||||||
{
|
{
|
||||||
using Iter = IT;
|
using Iter = IT;
|
||||||
using value_type = const typename IT::value_type::second_type;
|
using value_type = const IT::value_type::second_type;
|
||||||
using reference = const value_type &;
|
using reference = const value_type &;
|
||||||
using pointer = const value_type *;
|
using pointer = const value_type *;
|
||||||
|
|
||||||
|
|
@ -185,17 +185,17 @@ namespace iter_stl {
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
struct _MapTypeSelector
|
struct _MapTypeSelector
|
||||||
{
|
{
|
||||||
using Key = typename MAP::value_type::first_type;
|
using Key = MAP::value_type::first_type;
|
||||||
using Val = typename MAP::value_type::second_type;
|
using Val = MAP::value_type::second_type;
|
||||||
using Itr = typename MAP::iterator;
|
using Itr = MAP::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
struct _MapTypeSelector<const MAP>
|
struct _MapTypeSelector<const MAP>
|
||||||
{
|
{
|
||||||
using Key = typename MAP::value_type::first_type;
|
using Key = MAP::value_type::first_type;
|
||||||
using Val = typename MAP::value_type::second_type const;
|
using Val = MAP::value_type::second_type const;
|
||||||
using Itr = typename MAP::const_iterator;
|
using Itr = MAP::const_iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** helper to access the parts of the pair values correctly...*/
|
/** helper to access the parts of the pair values correctly...*/
|
||||||
|
|
@ -219,13 +219,13 @@ namespace iter_stl {
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
struct _MapT
|
struct _MapT
|
||||||
{
|
{
|
||||||
using KeyType = typename _MapTypeSelector<MAP>::Key;
|
using KeyType = _MapTypeSelector<MAP>::Key;
|
||||||
using ValType = typename _MapTypeSelector<MAP>::Val;
|
using ValType = _MapTypeSelector<MAP>::Val;
|
||||||
using EntryIter = typename _MapTypeSelector<MAP>::Itr;
|
using EntryIter = _MapTypeSelector<MAP>::Itr;
|
||||||
|
|
||||||
using DetectConst = typename EntryIter::reference;
|
using DetectConst = EntryIter::reference;
|
||||||
using PickKeyIter = typename _MapSubSelector<EntryIter,DetectConst>::PickKey;
|
using PickKeyIter = _MapSubSelector<EntryIter,DetectConst>::PickKey;
|
||||||
using PickValIter = typename _MapSubSelector<EntryIter,DetectConst>::PickVal;
|
using PickValIter = _MapSubSelector<EntryIter,DetectConst>::PickVal;
|
||||||
|
|
||||||
using KeyIter = RangeIter<PickKeyIter>;
|
using KeyIter = RangeIter<PickKeyIter>;
|
||||||
using ValIter = RangeIter<PickValIter>;
|
using ValIter = RangeIter<PickValIter>;
|
||||||
|
|
@ -239,12 +239,12 @@ namespace iter_stl {
|
||||||
{
|
{
|
||||||
using EntryIter = IT;
|
using EntryIter = IT;
|
||||||
|
|
||||||
using KeyType = typename EntryIter::value_type::first_type;
|
using KeyType = EntryIter::value_type::first_type;
|
||||||
using ValType = typename EntryIter::value_type::second_type;
|
using ValType = EntryIter::value_type::second_type;
|
||||||
|
|
||||||
using DetectConst = typename EntryIter::reference;
|
using DetectConst = EntryIter::reference;
|
||||||
using PickKeyIter = typename _MapSubSelector<EntryIter,DetectConst>::PickKey;
|
using PickKeyIter = _MapSubSelector<EntryIter,DetectConst>::PickKey;
|
||||||
using PickValIter = typename _MapSubSelector<EntryIter,DetectConst>::PickVal;
|
using PickValIter = _MapSubSelector<EntryIter,DetectConst>::PickVal;
|
||||||
|
|
||||||
using KeyIter = RangeIter<PickKeyIter>;
|
using KeyIter = RangeIter<PickKeyIter>;
|
||||||
using ValIter = RangeIter<PickValIter>;
|
using ValIter = RangeIter<PickValIter>;
|
||||||
|
|
@ -257,7 +257,7 @@ namespace iter_stl {
|
||||||
template<class SEQ>
|
template<class SEQ>
|
||||||
struct _SeqT
|
struct _SeqT
|
||||||
{
|
{
|
||||||
using Iter = typename SEQ::iterator;
|
using Iter = SEQ::iterator;
|
||||||
using Range = RangeIter<Iter>;
|
using Range = RangeIter<Iter>;
|
||||||
using DistinctVals = DistinctIter<Range>;
|
using DistinctVals = DistinctIter<Range>;
|
||||||
using Addrs = AddressExposingIter<Range>;
|
using Addrs = AddressExposingIter<Range>;
|
||||||
|
|
@ -266,7 +266,7 @@ namespace iter_stl {
|
||||||
template<class SEQ>
|
template<class SEQ>
|
||||||
struct _SeqT<const SEQ>
|
struct _SeqT<const SEQ>
|
||||||
{
|
{
|
||||||
using Iter = typename SEQ::const_iterator;
|
using Iter = SEQ::const_iterator;
|
||||||
using Range = RangeIter<Iter>;
|
using Range = RangeIter<Iter>;
|
||||||
using DistinctVals = DistinctIter<Range>;
|
using DistinctVals = DistinctIter<Range>;
|
||||||
using Addrs = AddressExposingIter<Range>;
|
using Addrs = AddressExposingIter<Range>;
|
||||||
|
|
@ -281,10 +281,10 @@ namespace iter_stl {
|
||||||
* to yield each Element from a STL container
|
* to yield each Element from a STL container
|
||||||
*/
|
*/
|
||||||
template<class CON>
|
template<class CON>
|
||||||
inline typename _SeqT<CON>::Range
|
inline _SeqT<CON>::Range
|
||||||
eachElm (CON& coll)
|
eachElm (CON& coll)
|
||||||
{
|
{
|
||||||
using Range = typename _SeqT<CON>::Range;
|
using Range = _SeqT<CON>::Range;
|
||||||
return Range (coll.begin(), coll.end());
|
return Range (coll.begin(), coll.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,10 +293,10 @@ namespace iter_stl {
|
||||||
* exposing the address of each Element within a STL
|
* exposing the address of each Element within a STL
|
||||||
*/
|
*/
|
||||||
template<class CON>
|
template<class CON>
|
||||||
inline typename _SeqT<CON>::Addrs
|
inline _SeqT<CON>::Addrs
|
||||||
eachAddress (CON& coll)
|
eachAddress (CON& coll)
|
||||||
{
|
{
|
||||||
using Addresses = typename _SeqT<CON>::Addrs;
|
using Addresses = _SeqT<CON>::Addrs;
|
||||||
return Addresses (eachElm (coll));
|
return Addresses (eachElm (coll));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,11 +305,11 @@ namespace iter_stl {
|
||||||
* each key of a map/multimap
|
* each key of a map/multimap
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
inline typename _MapT<MAP>::KeyIter
|
inline _MapT<MAP>::KeyIter
|
||||||
eachKey (MAP& map)
|
eachKey (MAP& map)
|
||||||
{
|
{
|
||||||
using Range = typename _MapT<MAP>::KeyIter;
|
using Range = _MapT<MAP>::KeyIter;
|
||||||
using PickKey = typename _MapT<MAP>::PickKeyIter;
|
using PickKey = _MapT<MAP>::PickKeyIter;
|
||||||
|
|
||||||
return Range (PickKey (map.begin()), PickKey (map.end()));
|
return Range (PickKey (map.begin()), PickKey (map.end()));
|
||||||
}
|
}
|
||||||
|
|
@ -319,11 +319,11 @@ namespace iter_stl {
|
||||||
* from a given range of (key,value) pairs
|
* from a given range of (key,value) pairs
|
||||||
*/
|
*/
|
||||||
template<class IT>
|
template<class IT>
|
||||||
inline typename _MapIterT<IT>::KeyIter
|
inline _MapIterT<IT>::KeyIter
|
||||||
eachKey (IT const& begin, IT const& end)
|
eachKey (IT const& begin, IT const& end)
|
||||||
{
|
{
|
||||||
using Range = typename _MapIterT<IT>::KeyIter;
|
using Range = _MapIterT<IT>::KeyIter;
|
||||||
using PickKey = typename _MapIterT<IT>::PickKeyIter;
|
using PickKey = _MapIterT<IT>::PickKeyIter;
|
||||||
|
|
||||||
return Range (PickKey (begin), PickKey (end));
|
return Range (PickKey (begin), PickKey (end));
|
||||||
}
|
}
|
||||||
|
|
@ -333,11 +333,11 @@ namespace iter_stl {
|
||||||
* each value within a map/multimap
|
* each value within a map/multimap
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
inline typename _MapT<MAP>::ValIter
|
inline _MapT<MAP>::ValIter
|
||||||
eachVal (MAP& map)
|
eachVal (MAP& map)
|
||||||
{
|
{
|
||||||
using Range = typename _MapT<MAP>::ValIter;
|
using Range = _MapT<MAP>::ValIter;
|
||||||
using PickVal = typename _MapT<MAP>::PickValIter;
|
using PickVal = _MapT<MAP>::PickValIter;
|
||||||
|
|
||||||
return Range (PickVal (map.begin()), PickVal (map.end()));
|
return Range (PickVal (map.begin()), PickVal (map.end()));
|
||||||
}
|
}
|
||||||
|
|
@ -347,11 +347,11 @@ namespace iter_stl {
|
||||||
* from a given range of (key,value) pairs
|
* from a given range of (key,value) pairs
|
||||||
*/
|
*/
|
||||||
template<class IT>
|
template<class IT>
|
||||||
inline typename _MapIterT<IT>::ValIter
|
inline _MapIterT<IT>::ValIter
|
||||||
eachVal (IT const& begin, IT const& end)
|
eachVal (IT const& begin, IT const& end)
|
||||||
{
|
{
|
||||||
using Range = typename _MapIterT<IT>::ValIter;
|
using Range = _MapIterT<IT>::ValIter;
|
||||||
using PickVal = typename _MapIterT<IT>::PickValIter;
|
using PickVal = _MapIterT<IT>::PickValIter;
|
||||||
|
|
||||||
return Range (PickVal (begin), PickVal (end));
|
return Range (PickVal (begin), PickVal (end));
|
||||||
}
|
}
|
||||||
|
|
@ -361,11 +361,11 @@ namespace iter_stl {
|
||||||
* any repetitions in the given sequence.
|
* any repetitions in the given sequence.
|
||||||
*/
|
*/
|
||||||
template<class SEQ>
|
template<class SEQ>
|
||||||
inline typename _SeqT<SEQ>::DistinctVals
|
inline _SeqT<SEQ>::DistinctVals
|
||||||
eachDistinct (SEQ& seq)
|
eachDistinct (SEQ& seq)
|
||||||
{
|
{
|
||||||
using Range = typename _SeqT<SEQ>::Range;
|
using Range = _SeqT<SEQ>::Range;
|
||||||
using DistinctValues = typename _SeqT<SEQ>::DistinctVals;
|
using DistinctValues = _SeqT<SEQ>::DistinctVals;
|
||||||
|
|
||||||
return DistinctValues (Range (seq.begin(), seq.end()));
|
return DistinctValues (Range (seq.begin(), seq.end()));
|
||||||
}
|
}
|
||||||
|
|
@ -376,7 +376,7 @@ namespace iter_stl {
|
||||||
* @warning full scan of all keys, dropping repetitions
|
* @warning full scan of all keys, dropping repetitions
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
inline typename _MapT<MAP>::DistinctKeys
|
inline _MapT<MAP>::DistinctKeys
|
||||||
eachDistinctKey (MAP& map)
|
eachDistinctKey (MAP& map)
|
||||||
{
|
{
|
||||||
return typename _MapT<MAP>::DistinctKeys (eachKey (map));
|
return typename _MapT<MAP>::DistinctKeys (eachKey (map));
|
||||||
|
|
@ -388,12 +388,12 @@ namespace iter_stl {
|
||||||
* @warning full scan of all keys, dropping repetitions
|
* @warning full scan of all keys, dropping repetitions
|
||||||
*/
|
*/
|
||||||
template<class MMAP, typename KEY>
|
template<class MMAP, typename KEY>
|
||||||
inline typename _MapT<MMAP>::ValIter
|
inline _MapT<MMAP>::ValIter
|
||||||
eachValForKey (MMAP& multimap, KEY key)
|
eachValForKey (MMAP& multimap, KEY key)
|
||||||
{
|
{
|
||||||
using Pos = typename _MapT<MMAP>::EntryIter;
|
using Pos = _MapT<MMAP>::EntryIter;
|
||||||
using Range = typename _MapT<MMAP>::ValIter;
|
using Range = _MapT<MMAP>::ValIter;
|
||||||
using PickVal = typename _MapT<MMAP>::PickValIter;
|
using PickVal = _MapT<MMAP>::PickValIter;
|
||||||
|
|
||||||
std::pair<Pos,Pos> valRange = multimap.equal_range (key);
|
std::pair<Pos,Pos> valRange = multimap.equal_range (key);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -212,9 +212,9 @@ namespace lib {
|
||||||
using _ValTrait = meta::ValueTypeBinding<std::remove_pointer_t<POS>>;
|
using _ValTrait = meta::ValueTypeBinding<std::remove_pointer_t<POS>>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename _ValTrait::value_type;
|
using value_type = _ValTrait::value_type;
|
||||||
using reference = typename _ValTrait::reference;
|
using reference = _ValTrait::reference;
|
||||||
using pointer = typename _ValTrait::pointer;
|
using pointer = _ValTrait::pointer;
|
||||||
|
|
||||||
|
|
||||||
IterAdapter (CON src, POS const& startpos)
|
IterAdapter (CON src, POS const& startpos)
|
||||||
|
|
@ -302,7 +302,7 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using ConRef = typename meta::RefTraits<CON>::Reference;
|
using ConRef = meta::RefTraits<CON>::Reference;
|
||||||
|
|
||||||
/** allow derived classes to access backing container */
|
/** allow derived classes to access backing container */
|
||||||
ConRef source() { return source_; }
|
ConRef source() { return source_; }
|
||||||
|
|
@ -376,9 +376,9 @@ namespace lib {
|
||||||
ST core_;
|
ST core_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename meta::RefTraits<T>::Value;
|
using value_type = meta::RefTraits<T>::Value;
|
||||||
using reference = typename meta::RefTraits<T>::Reference;
|
using reference = meta::RefTraits<T>::Reference;
|
||||||
using pointer = typename meta::RefTraits<T>::Pointer;
|
using pointer = meta::RefTraits<T>::Pointer;
|
||||||
|
|
||||||
IterStateWrapper (ST&& initialState)
|
IterStateWrapper (ST&& initialState)
|
||||||
: core_(std::forward<ST>(initialState))
|
: core_(std::forward<ST>(initialState))
|
||||||
|
|
@ -519,7 +519,7 @@ namespace lib {
|
||||||
return bool(srcIter());
|
return bool(srcIter());
|
||||||
}
|
}
|
||||||
|
|
||||||
typename IT::reference
|
IT::reference
|
||||||
yield() const
|
yield() const
|
||||||
{
|
{
|
||||||
return *srcIter();
|
return *srcIter();
|
||||||
|
|
@ -614,7 +614,7 @@ namespace lib {
|
||||||
class ContainerCore
|
class ContainerCore
|
||||||
: public CON
|
: public CON
|
||||||
{
|
{
|
||||||
using Iter = typename CON::iterator;
|
using Iter = CON::iterator;
|
||||||
|
|
||||||
Iter p_;
|
Iter p_;
|
||||||
|
|
||||||
|
|
@ -694,9 +694,9 @@ namespace lib {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using YieldRes = iter::CoreYield<COR>;
|
using YieldRes = iter::CoreYield<COR>;
|
||||||
using value_type = typename meta::RefTraits<YieldRes>::Value;
|
using value_type = meta::RefTraits<YieldRes>::Value;
|
||||||
using reference = typename meta::RefTraits<YieldRes>::Reference;
|
using reference = meta::RefTraits<YieldRes>::Reference;
|
||||||
using pointer = typename meta::RefTraits<YieldRes>::Pointer;
|
using pointer = meta::RefTraits<YieldRes>::Pointer;
|
||||||
|
|
||||||
|
|
||||||
/** by default, pass anything down for initialisation of the core.
|
/** by default, pass anything down for initialisation of the core.
|
||||||
|
|
@ -803,11 +803,11 @@ namespace lib {
|
||||||
using _ValTrait = meta::ValueTypeBinding<meta::remove_pointer_t<IT>>;
|
using _ValTrait = meta::ValueTypeBinding<meta::remove_pointer_t<IT>>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using pointer = typename _ValTrait::pointer;
|
using pointer = _ValTrait::pointer;
|
||||||
using reference = typename _ValTrait::reference;
|
using reference = _ValTrait::reference;
|
||||||
|
|
||||||
/// @note special twist, since a STL const_iterator would yield a non-const `value_type`
|
/// @note special twist, since a STL const_iterator would yield a non-const `value_type`
|
||||||
using value_type = typename std::remove_reference<reference>::type;
|
using value_type = std::remove_reference<reference>::type;
|
||||||
|
|
||||||
|
|
||||||
RangeIter (IT const& start, IT const& end)
|
RangeIter (IT const& start, IT const& end)
|
||||||
|
|
@ -1052,7 +1052,7 @@ namespace lib {
|
||||||
template<class T2>
|
template<class T2>
|
||||||
struct SimilarIter ///< rebind to rewritten Iterator wrapped into RangeIter
|
struct SimilarIter ///< rebind to rewritten Iterator wrapped into RangeIter
|
||||||
{
|
{
|
||||||
using WrappedIter = typename IterType<IT>::template SimilarIter<T2>::Type;
|
using WrappedIter = IterType<IT>::template SimilarIter<T2>::Type;
|
||||||
using Type = RangeIter<WrappedIter>;
|
using Type = RangeIter<WrappedIter>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -1067,9 +1067,9 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = const typename IT::value_type;
|
using value_type = const IT::value_type;
|
||||||
using pointer = const typename IT::pointer ;
|
using pointer = const IT::pointer ;
|
||||||
using reference = const typename IT::reference ;
|
using reference = const IT::reference ;
|
||||||
|
|
||||||
ConstIter (IT srcIter)
|
ConstIter (IT srcIter)
|
||||||
: i_(srcIter)
|
: i_(srcIter)
|
||||||
|
|
|
||||||
|
|
@ -150,11 +150,11 @@ namespace iter {
|
||||||
: public _IterChainSetup<SRC>::Pipeline
|
: public _IterChainSetup<SRC>::Pipeline
|
||||||
{
|
{
|
||||||
using _Trait = _IterChainSetup<SRC>;
|
using _Trait = _IterChainSetup<SRC>;
|
||||||
using _Base = typename _Trait::Pipeline;
|
using _Base = _Trait::Pipeline;
|
||||||
|
|
||||||
using Value = typename _Base::value_type;
|
using Value = _Base::value_type;
|
||||||
using Filter = typename _Trait::Filter;
|
using Filter = _Trait::Filter;
|
||||||
using Step = typename _Trait::StepFunctor;
|
using Step = _Trait::StepFunctor;
|
||||||
|
|
||||||
/** Storage for a sequence of filter configuration functors */
|
/** Storage for a sequence of filter configuration functors */
|
||||||
std::vector<Step> stepChain_;
|
std::vector<Step> stepChain_;
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using pointer = typename meta::ValueTypeBinding<IT>::pointer;
|
using pointer = meta::ValueTypeBinding<IT>::pointer;
|
||||||
using reference = typename meta::ValueTypeBinding<IT>::reference;
|
using reference = meta::ValueTypeBinding<IT>::reference;
|
||||||
using value_type = typename std::remove_reference<reference>::type; ///< @note will be const for const iterators (while const_iterator::value_type isn't)
|
using value_type = std::remove_reference<reference>::type; ///< @note will be const for const iterators (while const_iterator::value_type isn't)
|
||||||
|
|
||||||
|
|
||||||
CursorGear()
|
CursorGear()
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,9 @@ namespace lib {
|
||||||
namespace iter_explorer { // basic iterator wrappers...
|
namespace iter_explorer { // basic iterator wrappers...
|
||||||
|
|
||||||
template<class CON>
|
template<class CON>
|
||||||
using iterator = typename meta::Strip<CON>::TypeReferred::iterator;
|
using iterator = meta::Strip<CON>::TypeReferred::iterator;
|
||||||
template<class CON>
|
template<class CON>
|
||||||
using const_iterator = typename meta::Strip<CON>::TypeReferred::const_iterator;
|
using const_iterator = meta::Strip<CON>::TypeReferred::const_iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adapt STL compliant container.
|
* Adapt STL compliant container.
|
||||||
|
|
@ -190,7 +190,7 @@ namespace lib {
|
||||||
class IterSourceIter
|
class IterSourceIter
|
||||||
: public ISO::iterator
|
: public ISO::iterator
|
||||||
{
|
{
|
||||||
using Iterator = typename ISO::iterator;
|
using Iterator = ISO::iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IterSourceIter() =default;
|
IterSourceIter() =default;
|
||||||
|
|
@ -273,8 +273,8 @@ namespace lib {
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
struct _DecoratorTraits<SRC, enable_if<is_StateCore<SRC>>>
|
struct _DecoratorTraits<SRC, enable_if<is_StateCore<SRC>>>
|
||||||
{
|
{
|
||||||
using SrcRaw = typename lib::meta::Strip<SRC>::Type;
|
using SrcRaw = lib::meta::Strip<SRC>::Type;
|
||||||
using SrcVal = typename meta::RefTraits<iter::CoreYield<SrcRaw>>::Value;
|
using SrcVal = meta::RefTraits<iter::CoreYield<SrcRaw>>::Value;
|
||||||
using SrcIter = lib::IterableDecorator<lib::CheckedCore<SrcRaw>>;
|
using SrcIter = lib::IterableDecorator<lib::CheckedCore<SrcRaw>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -282,7 +282,7 @@ namespace lib {
|
||||||
struct _DecoratorTraits<SRC, enable_if<shall_use_Lumiera_Iter<SRC>>>
|
struct _DecoratorTraits<SRC, enable_if<shall_use_Lumiera_Iter<SRC>>>
|
||||||
{
|
{
|
||||||
using SrcIter = remove_reference_t<SRC>;
|
using SrcIter = remove_reference_t<SRC>;
|
||||||
using SrcVal = typename SrcIter::value_type;
|
using SrcVal = SrcIter::value_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
|
|
@ -291,14 +291,14 @@ namespace lib {
|
||||||
static_assert (not std::is_rvalue_reference<SRC>::value,
|
static_assert (not std::is_rvalue_reference<SRC>::value,
|
||||||
"container needs to exist elsewhere during the lifetime of the iteration");
|
"container needs to exist elsewhere during the lifetime of the iteration");
|
||||||
using SrcIter = iter_explorer::StlRange<SRC>;
|
using SrcIter = iter_explorer::StlRange<SRC>;
|
||||||
using SrcVal = typename SrcIter::value_type;
|
using SrcVal = SrcIter::value_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class ISO>
|
template<class ISO>
|
||||||
struct _DecoratorTraits<ISO*, enable_if<is_base_of<IterSource<typename ISO::value_type>, ISO>>>
|
struct _DecoratorTraits<ISO*, enable_if<is_base_of<IterSource<typename ISO::value_type>, ISO>>>
|
||||||
{
|
{
|
||||||
using SrcIter = iter_explorer::IterSourceIter<ISO>;
|
using SrcIter = iter_explorer::IterSourceIter<ISO>;
|
||||||
using SrcVal = typename ISO::value_type;
|
using SrcVal = ISO::value_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class ISO>
|
template<class ISO>
|
||||||
|
|
@ -324,7 +324,7 @@ namespace lib {
|
||||||
template<class SRC, class RES>
|
template<class SRC, class RES>
|
||||||
struct _ExpanderTraits
|
struct _ExpanderTraits
|
||||||
{
|
{
|
||||||
using ResIter = typename _DecoratorTraits<RES>::SrcIter;
|
using ResIter = _DecoratorTraits<RES>::SrcIter;
|
||||||
using SrcYield = iter::Yield<SRC>;
|
using SrcYield = iter::Yield<SRC>;
|
||||||
using ResYield = iter::Yield<ResIter>;
|
using ResYield = iter::Yield<ResIter>;
|
||||||
using _CommonT = meta::CommonResultYield<SrcYield,ResYield>;
|
using _CommonT = meta::CommonResultYield<SrcYield,ResYield>;
|
||||||
|
|
@ -336,10 +336,10 @@ namespace lib {
|
||||||
static_assert (is_const_v<SrcYield> == is_const_v<ResYield>,
|
static_assert (is_const_v<SrcYield> == is_const_v<ResYield>,
|
||||||
"source and expanded types differ in const-ness");
|
"source and expanded types differ in const-ness");
|
||||||
|
|
||||||
using YieldRes = typename _CommonT::ResType;
|
using YieldRes = _CommonT::ResType;
|
||||||
using value_type = typename _CommonT::value_type;
|
using value_type = _CommonT::value_type;
|
||||||
using reference = typename _CommonT::reference;
|
using reference = _CommonT::reference;
|
||||||
using pointer = typename _CommonT::pointer;
|
using pointer = _CommonT::pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
}//(End) IterExplorer traits
|
}//(End) IterExplorer traits
|
||||||
|
|
@ -389,22 +389,22 @@ namespace lib {
|
||||||
template<typename F, typename SEL =void>
|
template<typename F, typename SEL =void>
|
||||||
struct FunDetector
|
struct FunDetector
|
||||||
{
|
{
|
||||||
using Sig = typename _Fun<F>::Sig;
|
using Sig = _Fun<F>::Sig;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** handle a generic lambda, accepting a reference to the `SRC` iterator */
|
/** handle a generic lambda, accepting a reference to the `SRC` iterator */
|
||||||
template<typename F>
|
template<typename F>
|
||||||
struct FunDetector<F, disable_if<_Fun<F>> >
|
struct FunDetector<F, disable_if<_Fun<F>> >
|
||||||
{
|
{
|
||||||
using Arg = typename std::add_lvalue_reference<SRC>::type;
|
using Arg = std::add_lvalue_reference<SRC>::type;
|
||||||
using Ret = decltype(std::declval<F>() (std::declval<Arg>()));
|
using Ret = decltype(std::declval<F>() (std::declval<Arg>()));
|
||||||
using Sig = Ret(Arg);
|
using Sig = Ret(Arg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
using Sig = typename FunDetector<FUN>::Sig;
|
using Sig = FunDetector<FUN>::Sig;
|
||||||
using Arg = typename _Fun<Sig>::Args::List::Head; // assuming function with a single argument
|
using Arg = _Fun<Sig>::Args::List::Head; // assuming function with a single argument
|
||||||
using Res = typename _Fun<Sig>::Ret;
|
using Res = _Fun<Sig>::Ret;
|
||||||
static_assert (meta::is_UnaryFun<Sig>());
|
static_assert (meta::is_UnaryFun<Sig>());
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -442,7 +442,7 @@ namespace lib {
|
||||||
, is_base_of<IterSource<typename IT::value_type>, remove_reference_t<Arg>>
|
, is_base_of<IterSource<typename IT::value_type>, remove_reference_t<Arg>>
|
||||||
> >>
|
> >>
|
||||||
{
|
{
|
||||||
using Source = typename IT::Source;
|
using Source = IT::Source;
|
||||||
|
|
||||||
static auto
|
static auto
|
||||||
wrap (function<Sig> rawFun) ///< extract the (abstracted) IterSource
|
wrap (function<Sig> rawFun) ///< extract the (abstracted) IterSource
|
||||||
|
|
@ -466,7 +466,7 @@ namespace lib {
|
||||||
inline void
|
inline void
|
||||||
static_assert_isPredicate()
|
static_assert_isPredicate()
|
||||||
{
|
{
|
||||||
using Res = typename _FunTraits<FUN,SRC>::Res;
|
using Res = _FunTraits<FUN,SRC>::Res;
|
||||||
static_assert(std::is_constructible<bool, Res>::value, "Functor must be a predicate");
|
static_assert(std::is_constructible<bool, Res>::value, "Functor must be a predicate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -477,8 +477,8 @@ namespace lib {
|
||||||
template<class SRC, class FUN>
|
template<class SRC, class FUN>
|
||||||
struct _ReduceTraits
|
struct _ReduceTraits
|
||||||
{
|
{
|
||||||
using Result = typename iter_explorer::_FunTraits<FUN,SRC>::Res;
|
using Result = iter_explorer::_FunTraits<FUN,SRC>::Res;
|
||||||
using ResVal = typename lib::meta::RefTraits<Result>::Value;
|
using ResVal = lib::meta::RefTraits<Result>::Value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -557,7 +557,7 @@ namespace lib {
|
||||||
static_assert(can_IterForEach<SRC>::value, "Lumiera Iterator required as source");
|
static_assert(can_IterForEach<SRC>::value, "Lumiera Iterator required as source");
|
||||||
|
|
||||||
using _Trait = _ExpanderTraits<SRC,RES>;
|
using _Trait = _ExpanderTraits<SRC,RES>;
|
||||||
using ResIter = typename _Trait::ResIter;
|
using ResIter = _Trait::ResIter;
|
||||||
using RootExpandFunctor = function<RES(SRC&)>;
|
using RootExpandFunctor = function<RES(SRC&)>;
|
||||||
using ChldExpandFunctor = function<RES(ResIter&)>;
|
using ChldExpandFunctor = function<RES(ResIter&)>;
|
||||||
|
|
||||||
|
|
@ -621,10 +621,10 @@ namespace lib {
|
||||||
public: /* === Iteration control API for IterableDecorator === */
|
public: /* === Iteration control API for IterableDecorator === */
|
||||||
|
|
||||||
/** @note result type bindings based on a common type of source and expanded result */
|
/** @note result type bindings based on a common type of source and expanded result */
|
||||||
using YieldRes = typename _Trait::YieldRes;
|
using YieldRes = _Trait::YieldRes;
|
||||||
using value_type = typename _Trait::value_type;
|
using value_type = _Trait::value_type;
|
||||||
using reference = typename _Trait::reference;
|
using reference = _Trait::reference;
|
||||||
using pointer = typename _Trait::pointer;
|
using pointer = _Trait::pointer;
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -791,9 +791,9 @@ namespace lib {
|
||||||
TransformedItem treated_;
|
TransformedItem treated_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename meta::ValueTypeBinding<RES>::value_type;
|
using value_type = meta::ValueTypeBinding<RES>::value_type;
|
||||||
using reference = typename meta::ValueTypeBinding<RES>::reference;
|
using reference = meta::ValueTypeBinding<RES>::reference;
|
||||||
using pointer = typename meta::ValueTypeBinding<RES>::pointer;
|
using pointer = meta::ValueTypeBinding<RES>::pointer;
|
||||||
|
|
||||||
|
|
||||||
template<typename FUN>
|
template<typename FUN>
|
||||||
|
|
@ -896,7 +896,7 @@ namespace lib {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using Group = std::array<RES, grp>;
|
using Group = std::array<RES, grp>;
|
||||||
using Iter = typename Group::iterator;
|
using Iter = Group::iterator;
|
||||||
struct Buffer
|
struct Buffer
|
||||||
: lib::UninitialisedStorage<RES,grp>
|
: lib::UninitialisedStorage<RES,grp>
|
||||||
{
|
{
|
||||||
|
|
@ -1028,7 +1028,7 @@ namespace lib {
|
||||||
static_assert(can_IterForEach<SRC>::value, "Lumiera Iterator required as source");
|
static_assert(can_IterForEach<SRC>::value, "Lumiera Iterator required as source");
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using SrcValue = typename meta::ValueTypeBinding<SRC>::value_type;
|
using SrcValue = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
using Grouping = function<GRP(SRC&)>;
|
using Grouping = function<GRP(SRC&)>;
|
||||||
using Aggregator = function<void(AGG&, SrcValue&)>;
|
using Aggregator = function<void(AGG&, SrcValue&)>;
|
||||||
|
|
||||||
|
|
@ -1038,9 +1038,9 @@ namespace lib {
|
||||||
Aggregator aggregate_;
|
Aggregator aggregate_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename meta::RefTraits<AGG>::Value;
|
using value_type = meta::RefTraits<AGG>::Value;
|
||||||
using reference = typename meta::RefTraits<AGG>::Reference;
|
using reference = meta::RefTraits<AGG>::Reference;
|
||||||
using pointer = typename meta::RefTraits<AGG>::Pointer;
|
using pointer = meta::RefTraits<AGG>::Pointer;
|
||||||
|
|
||||||
GroupAggregator() =default;
|
GroupAggregator() =default;
|
||||||
// inherited default copy operations
|
// inherited default copy operations
|
||||||
|
|
@ -1152,7 +1152,7 @@ namespace lib {
|
||||||
return bool(srcIter());
|
return bool(srcIter());
|
||||||
}
|
}
|
||||||
|
|
||||||
typename SRC::reference
|
SRC::reference
|
||||||
yield() const
|
yield() const
|
||||||
{
|
{
|
||||||
return *srcIter();
|
return *srcIter();
|
||||||
|
|
@ -1446,7 +1446,7 @@ namespace lib {
|
||||||
, public ChildExpandableSource<typename SRC::value_type>
|
, public ChildExpandableSource<typename SRC::value_type>
|
||||||
{
|
{
|
||||||
using Parent = WrappedLumieraIter<SRC>;
|
using Parent = WrappedLumieraIter<SRC>;
|
||||||
using Val = typename SRC::value_type; ///////////////////////////////////TICKET #1125 : get rid of Val
|
using Val = SRC::value_type; ///////////////////////////////////TICKET #1125 : get rid of Val
|
||||||
|
|
||||||
~PackagedIterExplorerSource() { }
|
~PackagedIterExplorerSource() { }
|
||||||
public:
|
public:
|
||||||
|
|
@ -1583,9 +1583,9 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using value_type = typename meta::ValueTypeBinding<SRC>::value_type;
|
using value_type = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
using reference = typename meta::ValueTypeBinding<SRC>::reference;
|
using reference = meta::ValueTypeBinding<SRC>::reference;
|
||||||
using pointer = typename meta::ValueTypeBinding<SRC>::pointer;
|
using pointer = meta::ValueTypeBinding<SRC>::pointer;
|
||||||
|
|
||||||
using TAG_IterExplorer_Src = SRC; ///< @internal for \ref _PipelineDetector
|
using TAG_IterExplorer_Src = SRC; ///< @internal for \ref _PipelineDetector
|
||||||
|
|
||||||
|
|
@ -1640,10 +1640,10 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
expand (FUN&& expandFunctor)
|
expand (FUN&& expandFunctor)
|
||||||
{
|
{
|
||||||
using ExpandedChildren = typename iter_explorer::_FunTraits<FUN,SRC>::Res;
|
using ExpandedChildren = iter_explorer::_FunTraits<FUN,SRC>::Res;
|
||||||
|
|
||||||
using ResCore = iter_explorer::Expander<SRC, ExpandedChildren>;
|
using ResCore = iter_explorer::Expander<SRC, ExpandedChildren>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(expandFunctor)});
|
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(expandFunctor)});
|
||||||
}
|
}
|
||||||
|
|
@ -1664,7 +1664,7 @@ namespace lib {
|
||||||
expandAll()
|
expandAll()
|
||||||
{
|
{
|
||||||
using ResCore = iter_explorer::AutoExpander<SRC>;
|
using ResCore = iter_explorer::AutoExpander<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this)});
|
return IterExplorer<ResIter> (ResCore {move(*this)});
|
||||||
}
|
}
|
||||||
|
|
@ -1692,7 +1692,7 @@ namespace lib {
|
||||||
expandOnIteration()
|
expandOnIteration()
|
||||||
{
|
{
|
||||||
using ResCore = iter_explorer::ScheduledExpander<SRC>;
|
using ResCore = iter_explorer::ScheduledExpander<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this)});
|
return IterExplorer<ResIter> (ResCore {move(*this)});
|
||||||
}
|
}
|
||||||
|
|
@ -1712,10 +1712,10 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
transform (FUN&& transformFunctor)
|
transform (FUN&& transformFunctor)
|
||||||
{
|
{
|
||||||
using Product = typename iter_explorer::_FunTraits<FUN,SRC>::Res;
|
using Product = iter_explorer::_FunTraits<FUN,SRC>::Res;
|
||||||
|
|
||||||
using ResCore = iter_explorer::Transformer<SRC, Product>;
|
using ResCore = iter_explorer::Transformer<SRC, Product>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(transformFunctor)});
|
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(transformFunctor)});
|
||||||
}
|
}
|
||||||
|
|
@ -1733,9 +1733,9 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
grouped()
|
grouped()
|
||||||
{
|
{
|
||||||
using Value = typename meta::ValueTypeBinding<SRC>::value_type;
|
using Value = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
using ResCore = iter_explorer::Grouping<SRC, Value, grp>;
|
using ResCore = iter_explorer::Grouping<SRC, Value, grp>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this)});
|
return IterExplorer<ResIter> (ResCore {move(*this)});
|
||||||
}
|
}
|
||||||
|
|
@ -1756,14 +1756,14 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
groupedBy (FGRP&& groupFun, FAGG&& aggFun)
|
groupedBy (FGRP&& groupFun, FAGG&& aggFun)
|
||||||
{
|
{
|
||||||
using GroupVal = typename iter_explorer::_FunTraits<FGRP,SRC>::Res;
|
using GroupVal = iter_explorer::_FunTraits<FGRP,SRC>::Res;
|
||||||
|
|
||||||
static_assert (meta::is_BinaryFun<FAGG>());
|
static_assert (meta::is_BinaryFun<FAGG>());
|
||||||
using ArgType1 = typename _Fun<FAGG>::Args::List::Head;
|
using ArgType1 = _Fun<FAGG>::Args::List::Head;
|
||||||
using Aggregate = typename meta::RefTraits<ArgType1>::Value;
|
using Aggregate = meta::RefTraits<ArgType1>::Value;
|
||||||
|
|
||||||
using ResCore = iter_explorer::GroupAggregator<SRC, Aggregate, GroupVal>;
|
using ResCore = iter_explorer::GroupAggregator<SRC, Aggregate, GroupVal>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this)
|
return IterExplorer<ResIter> (ResCore {move(*this)
|
||||||
,forward<FGRP> (groupFun)
|
,forward<FGRP> (groupFun)
|
||||||
|
|
@ -1775,7 +1775,7 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
groupedBy (FGRP&& groupFun)
|
groupedBy (FGRP&& groupFun)
|
||||||
{
|
{
|
||||||
using Value = typename meta::ValueTypeBinding<SRC>::value_type;
|
using Value = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
return groupedBy (forward<FGRP> (groupFun)
|
return groupedBy (forward<FGRP> (groupFun)
|
||||||
,[](Value& agg, Value const& val){ agg += val; }
|
,[](Value& agg, Value const& val){ agg += val; }
|
||||||
);
|
);
|
||||||
|
|
@ -1792,7 +1792,7 @@ namespace lib {
|
||||||
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
||||||
|
|
||||||
using ResCore = iter_explorer::StopTrigger<SRC>;
|
using ResCore = iter_explorer::StopTrigger<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(whileCond)});
|
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(whileCond)});
|
||||||
}
|
}
|
||||||
|
|
@ -1808,8 +1808,8 @@ namespace lib {
|
||||||
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
||||||
|
|
||||||
using ResCore = iter_explorer::StopTrigger<SRC>;
|
using ResCore = iter_explorer::StopTrigger<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
using ArgType = typename iter_explorer::_FunTraits<FUN,SRC>::Arg;
|
using ArgType = iter_explorer::_FunTraits<FUN,SRC>::Arg;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore { move(*this)
|
return IterExplorer<ResIter> (ResCore { move(*this)
|
||||||
,[whileCond = forward<FUN>(untilCond)](ArgType val)
|
,[whileCond = forward<FUN>(untilCond)](ArgType val)
|
||||||
|
|
@ -1833,7 +1833,7 @@ namespace lib {
|
||||||
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
||||||
|
|
||||||
using ResCore = iter_explorer::Filter<SRC>;
|
using ResCore = iter_explorer::Filter<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(filterPredicate)});
|
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(filterPredicate)});
|
||||||
}
|
}
|
||||||
|
|
@ -1863,7 +1863,7 @@ namespace lib {
|
||||||
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
iter_explorer::static_assert_isPredicate<FUN,SRC>();
|
||||||
|
|
||||||
using ResCore = iter_explorer::MutableFilter<SRC>;
|
using ResCore = iter_explorer::MutableFilter<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(filterPredicate)});
|
return IterExplorer<ResIter> (ResCore {move(*this), forward<FUN>(filterPredicate)});
|
||||||
}
|
}
|
||||||
|
|
@ -1893,7 +1893,7 @@ namespace lib {
|
||||||
processingLayer()
|
processingLayer()
|
||||||
{
|
{
|
||||||
using ResCore = LAY<SRC>;
|
using ResCore = LAY<SRC>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
|
|
||||||
return IterExplorer<ResIter> (ResCore {move(*this)});
|
return IterExplorer<ResIter> (ResCore {move(*this)});
|
||||||
}
|
}
|
||||||
|
|
@ -1904,7 +1904,7 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
asPtr()
|
asPtr()
|
||||||
{
|
{
|
||||||
using Val = typename meta::ValueTypeBinding<SRC>::value_type;
|
using Val = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
static_assert (not std::is_pointer_v<Val>);
|
static_assert (not std::is_pointer_v<Val>);
|
||||||
return IterExplorer::transform ([](Val& ref){ return &ref; });
|
return IterExplorer::transform ([](Val& ref){ return &ref; });
|
||||||
}
|
}
|
||||||
|
|
@ -1913,7 +1913,7 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
derefPtr()
|
derefPtr()
|
||||||
{
|
{
|
||||||
using Ptr = typename meta::ValueTypeBinding<SRC>::value_type;
|
using Ptr = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
return IterExplorer::transform ([](Ptr ptr){ return *ptr; });
|
return IterExplorer::transform ([](Ptr ptr){ return *ptr; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1925,9 +1925,9 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
deduplicate()
|
deduplicate()
|
||||||
{
|
{
|
||||||
using Value = typename meta::ValueTypeBinding<SRC>::value_type;
|
using Value = meta::ValueTypeBinding<SRC>::value_type;
|
||||||
using ResCore = ContainerCore<SET<Value>>;
|
using ResCore = ContainerCore<SET<Value>>;
|
||||||
using ResIter = typename _DecoratorTraits<ResCore>::SrcIter;
|
using ResIter = _DecoratorTraits<ResCore>::SrcIter;
|
||||||
SET<Value> buffer;
|
SET<Value> buffer;
|
||||||
for (auto& val : *this)
|
for (auto& val : *this)
|
||||||
buffer.emplace (val);
|
buffer.emplace (val);
|
||||||
|
|
@ -2106,7 +2106,7 @@ namespace lib {
|
||||||
template<class COR> // used when actually a CheckedCore was attached
|
template<class COR> // used when actually a CheckedCore was attached
|
||||||
struct _UnstripAdapter<COR, std::void_t<typename COR::TAG_CheckedCore_Raw> >
|
struct _UnstripAdapter<COR, std::void_t<typename COR::TAG_CheckedCore_Raw> >
|
||||||
{
|
{
|
||||||
using RawIter = typename COR::TAG_CheckedCore_Raw;
|
using RawIter = COR::TAG_CheckedCore_Raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2123,8 +2123,8 @@ namespace lib {
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
struct _PipelineDetector<SRC, std::void_t<typename SRC::TAG_IterExplorer_Src> >
|
struct _PipelineDetector<SRC, std::void_t<typename SRC::TAG_IterExplorer_Src> >
|
||||||
{
|
{
|
||||||
using _SrcIT = typename SRC::TAG_IterExplorer_Src;
|
using _SrcIT = SRC::TAG_IterExplorer_Src;
|
||||||
using RawIter = typename _UnstripAdapter<_SrcIT>::RawIter;
|
using RawIter = _UnstripAdapter<_SrcIT>::RawIter;
|
||||||
};
|
};
|
||||||
}//(End)internal adapter logic
|
}//(End)internal adapter logic
|
||||||
|
|
||||||
|
|
@ -2188,9 +2188,9 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
explore (IT&& srcSeq)
|
explore (IT&& srcSeq)
|
||||||
{
|
{
|
||||||
using RawIter = typename _PipelineDetector<IT>::RawIter; // possibly strip an underlying IterExplorer
|
using RawIter = _PipelineDetector<IT>::RawIter; // possibly strip an underlying IterExplorer
|
||||||
using SrcIter = typename _DecoratorTraits<RawIter>::SrcIter; // then decide how to adapt the source / iterator
|
using SrcIter = _DecoratorTraits<RawIter>::SrcIter; // then decide how to adapt the source / iterator
|
||||||
using Base = typename _BaseDetector<SrcIter>::BaseAdapter; // detect if a BaseAdapter exists or must be added
|
using Base = _BaseDetector<SrcIter>::BaseAdapter; // detect if a BaseAdapter exists or must be added
|
||||||
|
|
||||||
return IterExplorer<Base> (std::forward<IT> (srcSeq));
|
return IterExplorer<Base> (std::forward<IT> (srcSeq));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ namespace lib {
|
||||||
|
|
||||||
/** storage for the empty data-source constant */
|
/** storage for the empty data-source constant */
|
||||||
template<typename TY>
|
template<typename TY>
|
||||||
typename IterSource<TY>::iterator IterSource<TY>::EMPTY_SOURCE = iterator();
|
IterSource<TY>::iterator IterSource<TY>::EMPTY_SOURCE = iterator();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -226,7 +226,7 @@ namespace lib {
|
||||||
IT src_;
|
IT src_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using Pos = typename ISO::Pos;
|
using Pos = ISO::Pos;
|
||||||
|
|
||||||
Pos ////////////////////////////////////////////////////TICKET #1125 : this API should use three control functions, similar to IterStateWrapper
|
Pos ////////////////////////////////////////////////////TICKET #1125 : this API should use three control functions, similar to IterStateWrapper
|
||||||
firstResult ()
|
firstResult ()
|
||||||
|
|
@ -276,55 +276,55 @@ namespace lib {
|
||||||
template<class CON>
|
template<class CON>
|
||||||
struct _SeqT
|
struct _SeqT
|
||||||
{
|
{
|
||||||
using Val = typename CON::iterator::value_type;
|
using Val = CON::iterator::value_type;
|
||||||
using Iter = typename IterSource<Val>::iterator;
|
using Iter = IterSource<Val>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
struct _RangeT
|
struct _RangeT
|
||||||
{
|
{
|
||||||
using Val = typename IT::value_type;
|
using Val = IT::value_type;
|
||||||
using Iter = typename IterSource<Val>::iterator;
|
using Iter = IterSource<Val>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
struct _MapT
|
struct _MapT
|
||||||
{
|
{
|
||||||
using Key = typename MAP::key_type;
|
using Key = MAP::key_type;
|
||||||
using Val = typename MAP::value_type::second_type;
|
using Val = MAP::value_type::second_type;
|
||||||
using KeyIter = typename IterSource<Key>::iterator;
|
using KeyIter = IterSource<Key>::iterator;
|
||||||
using ValIter = typename IterSource<Val>::iterator;
|
using ValIter = IterSource<Val>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
struct _IterT
|
struct _IterT
|
||||||
{
|
{
|
||||||
using Src = typename std::remove_reference<IT>::type;
|
using Src = std::remove_reference<IT>::type;
|
||||||
using Val = typename Src::value_type;
|
using Val = Src::value_type;
|
||||||
using Iter = typename IterSource<Val>::iterator;
|
using Iter = IterSource<Val>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class IT, class FUN>
|
template<class IT, class FUN>
|
||||||
struct _TransformIterT
|
struct _TransformIterT
|
||||||
{
|
{
|
||||||
using Src = typename std::remove_reference<IT>::type;
|
using Src = std::remove_reference<IT>::type;
|
||||||
using ResVal = typename lib::meta::_Fun<FUN>::Ret;
|
using ResVal = lib::meta::_Fun<FUN>::Ret;
|
||||||
using TransIter = TransformIter<Src, ResVal>;
|
using TransIter = TransformIter<Src, ResVal>;
|
||||||
using Iter = typename IterSource<ResVal>::iterator;
|
using Iter = IterSource<ResVal>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
struct _PairIterT
|
struct _PairIterT
|
||||||
{
|
{
|
||||||
using Src = typename std::remove_reference<IT>::type;
|
using Src = std::remove_reference<IT>::type;
|
||||||
using PairType = typename Src::value_type;
|
using PairType = Src::value_type;
|
||||||
using ValType = typename PairType::second_type;
|
using ValType = PairType::second_type;
|
||||||
using ConstKeyType = typename PairType::first_type;
|
using ConstKeyType = PairType::first_type;
|
||||||
|
|
||||||
// since we're returning the keys always by value,
|
// since we're returning the keys always by value,
|
||||||
// we can strip the const added by the STL map types
|
// we can strip the const added by the STL map types
|
||||||
using KeyType = typename std::remove_const<ConstKeyType>::type;
|
using KeyType = std::remove_const<ConstKeyType>::type;
|
||||||
|
|
||||||
using KeyIter = TransformIter<Src, KeyType>;
|
using KeyIter = TransformIter<Src, KeyType>;
|
||||||
using ValIter = TransformIter<Src, ValType>;
|
using ValIter = TransformIter<Src, ValType>;
|
||||||
|
|
@ -335,14 +335,14 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
typename _PairIterT<IT>::KeyIter
|
_PairIterT<IT>::KeyIter
|
||||||
takePairFirst (IT&& source)
|
takePairFirst (IT&& source)
|
||||||
{
|
{
|
||||||
return transformIterator(forward<IT>(source), _PairIterT<IT>::takeFirst );
|
return transformIterator(forward<IT>(source), _PairIterT<IT>::takeFirst );
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
typename _PairIterT<IT>::ValIter
|
_PairIterT<IT>::ValIter
|
||||||
takePairSecond (IT&& source)
|
takePairSecond (IT&& source)
|
||||||
{
|
{
|
||||||
return transformIterator(forward<IT>(source), _PairIterT<IT>::takeSecond );
|
return transformIterator(forward<IT>(source), _PairIterT<IT>::takeSecond );
|
||||||
|
|
@ -356,11 +356,11 @@ namespace lib {
|
||||||
* exposing just a IterSource based frontend.
|
* exposing just a IterSource based frontend.
|
||||||
*/
|
*/
|
||||||
template<class IT>
|
template<class IT>
|
||||||
typename _IterT<IT>::Iter
|
_IterT<IT>::Iter
|
||||||
wrapIter (IT&& source)
|
wrapIter (IT&& source)
|
||||||
{
|
{
|
||||||
using Src = typename _IterT<IT>::Src;
|
using Src = _IterT<IT>::Src;
|
||||||
using Val = typename _IterT<IT>::Val;
|
using Val = _IterT<IT>::Val;
|
||||||
|
|
||||||
return IterSource<Val>::build (new WrappedLumieraIter<Src> (forward<IT>(source)));
|
return IterSource<Val>::build (new WrappedLumieraIter<Src> (forward<IT>(source)));
|
||||||
}
|
}
|
||||||
|
|
@ -376,7 +376,7 @@ namespace lib {
|
||||||
singleVal (VAL&& something)
|
singleVal (VAL&& something)
|
||||||
{
|
{
|
||||||
using Src = decltype(singleValIterator (forward<VAL>(something)));
|
using Src = decltype(singleValIterator (forward<VAL>(something)));
|
||||||
using Val = typename _IterT<Src>::Val;
|
using Val = _IterT<Src>::Val;
|
||||||
|
|
||||||
return IterSource<Val>::build (new WrappedLumieraIter<Src>{singleValIterator (forward<VAL>(something))});
|
return IterSource<Val>::build (new WrappedLumieraIter<Src>{singleValIterator (forward<VAL>(something))});
|
||||||
}
|
}
|
||||||
|
|
@ -392,11 +392,11 @@ namespace lib {
|
||||||
* function call for every fetched element.
|
* function call for every fetched element.
|
||||||
*/
|
*/
|
||||||
template<class IT, class FUN>
|
template<class IT, class FUN>
|
||||||
typename _TransformIterT<IT,FUN>::Iter
|
_TransformIterT<IT,FUN>::Iter
|
||||||
transform (IT&& source, FUN processingFunc)
|
transform (IT&& source, FUN processingFunc)
|
||||||
{
|
{
|
||||||
using ValType = typename _TransformIterT<IT,FUN>::ResVal;
|
using ValType = _TransformIterT<IT,FUN>::ResVal;
|
||||||
using TransIT = typename _TransformIterT<IT,FUN>::TransIter;
|
using TransIT = _TransformIterT<IT,FUN>::TransIter;
|
||||||
|
|
||||||
return IterSource<ValType>::build (
|
return IterSource<ValType>::build (
|
||||||
new WrappedLumieraIter<TransIT> (
|
new WrappedLumieraIter<TransIT> (
|
||||||
|
|
@ -408,7 +408,7 @@ namespace lib {
|
||||||
* all the keys of the given Map or Hashtable
|
* all the keys of the given Map or Hashtable
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
typename _MapT<MAP>::KeyIter
|
_MapT<MAP>::KeyIter
|
||||||
eachMapKey (MAP& map)
|
eachMapKey (MAP& map)
|
||||||
{
|
{
|
||||||
using Range = RangeIter<typename MAP::iterator>;
|
using Range = RangeIter<typename MAP::iterator>;
|
||||||
|
|
@ -422,7 +422,7 @@ namespace lib {
|
||||||
* all the values of the given Map or Hashtable
|
* all the values of the given Map or Hashtable
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
typename _MapT<MAP>::ValIter
|
_MapT<MAP>::ValIter
|
||||||
eachMapVal (MAP& map)
|
eachMapVal (MAP& map)
|
||||||
{
|
{
|
||||||
using Range = RangeIter<typename MAP::iterator>;
|
using Range = RangeIter<typename MAP::iterator>;
|
||||||
|
|
@ -438,7 +438,7 @@ namespace lib {
|
||||||
* the distinct keys
|
* the distinct keys
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
typename _MapT<MAP>::KeyIter
|
_MapT<MAP>::KeyIter
|
||||||
eachDistinctKey (MAP& map)
|
eachDistinctKey (MAP& map)
|
||||||
{
|
{
|
||||||
using Range = RangeIter<typename MAP::iterator>;
|
using Range = RangeIter<typename MAP::iterator>;
|
||||||
|
|
@ -453,10 +453,10 @@ namespace lib {
|
||||||
* @note obviously in case of a Map we'll get at most one result.
|
* @note obviously in case of a Map we'll get at most one result.
|
||||||
*/
|
*/
|
||||||
template<class MAP>
|
template<class MAP>
|
||||||
typename _MapT<MAP>::ValIter
|
_MapT<MAP>::ValIter
|
||||||
eachValForKey (MAP& map, typename _MapT<MAP>::Key key)
|
eachValForKey (MAP& map, typename _MapT<MAP>::Key key)
|
||||||
{
|
{
|
||||||
using Pos = typename MAP::iterator;
|
using Pos = MAP::iterator;
|
||||||
using Range = RangeIter<Pos>;
|
using Range = RangeIter<Pos>;
|
||||||
|
|
||||||
std::pair<Pos,Pos> valuesForKey = map.equal_range(key);
|
std::pair<Pos,Pos> valuesForKey = map.equal_range(key);
|
||||||
|
|
@ -472,10 +472,10 @@ namespace lib {
|
||||||
* starting with \c begin and excluding \c end .
|
* starting with \c begin and excluding \c end .
|
||||||
*/
|
*/
|
||||||
template<class CON>
|
template<class CON>
|
||||||
typename _SeqT<CON>::Iter
|
_SeqT<CON>::Iter
|
||||||
eachEntry (CON& container)
|
eachEntry (CON& container)
|
||||||
{
|
{
|
||||||
using ValType = typename _SeqT<CON>::Val;
|
using ValType = _SeqT<CON>::Val;
|
||||||
using Range = RangeIter<typename CON::iterator>;
|
using Range = RangeIter<typename CON::iterator>;
|
||||||
|
|
||||||
Range contents (container.begin(), container.end());
|
Range contents (container.begin(), container.end());
|
||||||
|
|
@ -487,10 +487,10 @@ namespace lib {
|
||||||
* defined by a classical Iterator range.
|
* defined by a classical Iterator range.
|
||||||
*/
|
*/
|
||||||
template<class IT>
|
template<class IT>
|
||||||
typename _RangeT<IT>::Iter
|
_RangeT<IT>::Iter
|
||||||
eachEntry (IT const& begin, IT const& end)
|
eachEntry (IT const& begin, IT const& end)
|
||||||
{
|
{
|
||||||
using ValType = typename _RangeT<IT>::Val;
|
using ValType = _RangeT<IT>::Val;
|
||||||
using Range = RangeIter<IT>;
|
using Range = RangeIter<IT>;
|
||||||
|
|
||||||
Range contents (begin, end);
|
Range contents (begin, end);
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,9 @@ namespace lib {
|
||||||
return bool(source_);
|
return bool(source_);
|
||||||
}
|
}
|
||||||
|
|
||||||
using pointer = typename IT::pointer;
|
using pointer = IT::pointer;
|
||||||
using reference = typename IT::reference;
|
using reference = IT::reference;
|
||||||
using value_type = typename IT::value_type;
|
using value_type = IT::value_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -186,9 +186,9 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using pointer = typename CORE::pointer;
|
using pointer = CORE::pointer;
|
||||||
using reference = typename CORE::reference;
|
using reference = CORE::reference;
|
||||||
using value_type = typename CORE::value_type;
|
using value_type = CORE::value_type;
|
||||||
|
|
||||||
|
|
||||||
IterTool (CORE&& setup)
|
IterTool (CORE&& setup)
|
||||||
|
|
@ -341,7 +341,7 @@ namespace lib {
|
||||||
typedef IterTool<_Filter> _Impl;
|
typedef IterTool<_Filter> _Impl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool acceptAll(typename _Filter::Val) { return true; }
|
static bool acceptAll(_Filter::Val) { return true; }
|
||||||
|
|
||||||
|
|
||||||
FilterIter ()
|
FilterIter ()
|
||||||
|
|
@ -378,7 +378,7 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
filterIterator (IT&& src, PRED filterPredicate)
|
filterIterator (IT&& src, PRED filterPredicate)
|
||||||
{
|
{
|
||||||
using SrcIT = typename std::remove_reference<IT>::type;
|
using SrcIT = std::remove_reference<IT>::type;
|
||||||
return FilterIter<SrcIT>{forward<IT>(src), filterPredicate};
|
return FilterIter<SrcIT>{forward<IT>(src), filterPredicate};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -411,7 +411,7 @@ namespace lib {
|
||||||
: public FilterIter<IT>
|
: public FilterIter<IT>
|
||||||
{
|
{
|
||||||
using _Filter = FilterCore<IT>;
|
using _Filter = FilterCore<IT>;
|
||||||
using Val = typename _Filter::Val;
|
using Val = _Filter::Val;
|
||||||
|
|
||||||
void
|
void
|
||||||
reEvaluate()
|
reEvaluate()
|
||||||
|
|
@ -739,9 +739,9 @@ namespace lib {
|
||||||
return bool(source_);
|
return bool(source_);
|
||||||
}
|
}
|
||||||
|
|
||||||
using pointer = typename ValueTypeBinding<VAL>::pointer;
|
using pointer = ValueTypeBinding<VAL>::pointer;
|
||||||
using reference = typename ValueTypeBinding<VAL>::reference;
|
using reference = ValueTypeBinding<VAL>::reference;
|
||||||
using value_type = typename ValueTypeBinding<VAL>::value_type;
|
using value_type = ValueTypeBinding<VAL>::value_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -787,7 +787,7 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
transformIterator (IT const& src, FUN processingFunc)
|
transformIterator (IT const& src, FUN processingFunc)
|
||||||
{
|
{
|
||||||
using OutVal = typename lib::meta::_Fun<FUN>::Ret;
|
using OutVal = lib::meta::_Fun<FUN>::Ret;
|
||||||
return TransformIter<IT,OutVal>{src,processingFunc};
|
return TransformIter<IT,OutVal>{src,processingFunc};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -795,8 +795,8 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
transformIterator (IT&& src, FUN processingFunc)
|
transformIterator (IT&& src, FUN processingFunc)
|
||||||
{
|
{
|
||||||
using SrcIT = typename std::remove_reference<IT>::type;
|
using SrcIT = std::remove_reference<IT>::type;
|
||||||
using OutVal = typename lib::meta::_Fun<FUN>::Ret;
|
using OutVal = lib::meta::_Fun<FUN>::Ret;
|
||||||
return TransformIter<SrcIT,OutVal>{forward<IT>(src), processingFunc};
|
return TransformIter<SrcIT,OutVal>{forward<IT>(src), processingFunc};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -815,10 +815,10 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
template<class IT>
|
template<class IT>
|
||||||
inline typename IT::value_type
|
inline IT::value_type
|
||||||
pull_last (IT iter)
|
pull_last (IT iter)
|
||||||
{
|
{
|
||||||
using Val = typename IT::value_type;
|
using Val = IT::value_type;
|
||||||
using Item = wrapper::ItemWrapper<Val>;
|
using Item = wrapper::ItemWrapper<Val>;
|
||||||
|
|
||||||
Item lastElm;
|
Item lastElm;
|
||||||
|
|
@ -845,7 +845,7 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
filterRepetitions (IT const& source)
|
filterRepetitions (IT const& source)
|
||||||
{
|
{
|
||||||
using Val = typename meta::ValueTypeBinding<IT>::value_type;
|
using Val = meta::ValueTypeBinding<IT>::value_type;
|
||||||
return filterIterator (source, SkipRepetition<Val>());
|
return filterIterator (source, SkipRepetition<Val>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -853,7 +853,7 @@ namespace lib {
|
||||||
inline auto
|
inline auto
|
||||||
filterRepetitions (IT&& source)
|
filterRepetitions (IT&& source)
|
||||||
{
|
{
|
||||||
using Val = typename meta::ValueTypeBinding<IT>::value_type;
|
using Val = meta::ValueTypeBinding<IT>::value_type;
|
||||||
return filterIterator (forward<IT>(source), SkipRepetition<Val>() );
|
return filterIterator (forward<IT>(source), SkipRepetition<Val>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ namespace lib {
|
||||||
generateTrap (DEL* delegate)
|
generateTrap (DEL* delegate)
|
||||||
{
|
{
|
||||||
static_assert (_Fun<DEL>(), "Delegate must be function-like");
|
static_assert (_Fun<DEL>(), "Delegate must be function-like");
|
||||||
using Ret = typename _Fun<DEL>::Ret;
|
using Ret = _Fun<DEL>::Ret;
|
||||||
static_assert (_Fun<Ret>(), "Result from invoking delegate must also be function-like");
|
static_assert (_Fun<Ret>(), "Result from invoking delegate must also be function-like");
|
||||||
static_assert (has_Sig<Ret, SIG>(), "Result from delegate must expose target signature");
|
static_assert (has_Sig<Ret, SIG>(), "Result from delegate must expose target signature");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ namespace lib {
|
||||||
* discarding of node elements
|
* discarding of node elements
|
||||||
*/
|
*/
|
||||||
explicit
|
explicit
|
||||||
LinkedElements (typename ALO::CustomAllocator allo)
|
LinkedElements (ALO::CustomAllocator allo)
|
||||||
: ALO{allo}
|
: ALO{allo}
|
||||||
, head_{nullptr}
|
, head_{nullptr}
|
||||||
{ }
|
{ }
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@
|
||||||
{ \
|
{ \
|
||||||
\
|
\
|
||||||
template<class X> \
|
template<class X> \
|
||||||
static Yes_t check(typename X::_TYPE_ *); \
|
static Yes_t check(X::_TYPE_ *); \
|
||||||
template<class> \
|
template<class> \
|
||||||
static No_t check(...); \
|
static No_t check(...); \
|
||||||
\
|
\
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
template<class X> \
|
template<class X> \
|
||||||
static Yes_t check(typename Probe<decltype(&X::_FUN_NAME_)>::Match * ); \
|
static Yes_t check(Probe<decltype(&X::_FUN_NAME_)>::Match * ); \
|
||||||
template<class> \
|
template<class> \
|
||||||
static No_t check(...); \
|
static No_t check(...); \
|
||||||
\
|
\
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ namespace func{
|
||||||
template<typename X, typename TAIL, size_t i>
|
template<typename X, typename TAIL, size_t i>
|
||||||
struct PlaceholderTuple<Node<X,TAIL>, i>
|
struct PlaceholderTuple<Node<X,TAIL>, i>
|
||||||
{
|
{
|
||||||
using TailPlaceholders = typename PlaceholderTuple<TAIL,i+1>::List;
|
using TailPlaceholders = PlaceholderTuple<TAIL,i+1>::List;
|
||||||
|
|
||||||
using List = Node<_Placeholder<i>, TailPlaceholders>;
|
using List = Node<_Placeholder<i>, TailPlaceholders>;
|
||||||
};
|
};
|
||||||
|
|
@ -136,7 +136,7 @@ namespace func{
|
||||||
struct PartiallyInitTuple
|
struct PartiallyInitTuple
|
||||||
{
|
{
|
||||||
template<size_t i>
|
template<size_t i>
|
||||||
using DestType = typename std::tuple_element_t<i, TAR>;
|
using DestType = std::tuple_element_t<i, TAR>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -257,8 +257,8 @@ namespace func{
|
||||||
buildInvokableWrapper (FUN&& fun)
|
buildInvokableWrapper (FUN&& fun)
|
||||||
{
|
{
|
||||||
static_assert (is_Typelist<TYPES>::value);
|
static_assert (is_Typelist<TYPES>::value);
|
||||||
using ArgTypes = typename TYPES::Seq;
|
using ArgTypes = TYPES::Seq;
|
||||||
using Builder = typename lib::meta::RebindVariadic<AdaptInvokable, ArgTypes>::Type;
|
using Builder = lib::meta::RebindVariadic<AdaptInvokable, ArgTypes>::Type;
|
||||||
|
|
||||||
return Builder::buildWrapper (forward<FUN> (fun));
|
return Builder::buildWrapper (forward<FUN> (fun));
|
||||||
}
|
}
|
||||||
|
|
@ -290,11 +290,11 @@ namespace func{
|
||||||
template<typename SIG, typename VAL>
|
template<typename SIG, typename VAL>
|
||||||
class PApply
|
class PApply
|
||||||
{
|
{
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using Ret = typename _Fun<SIG>::Ret;
|
using Ret = _Fun<SIG>::Ret;
|
||||||
using ArgsList = typename Args::List;
|
using ArgsList = Args::List;
|
||||||
using ValList = typename VAL::List;
|
using ValList = VAL::List;
|
||||||
using ValTypes = typename Types<ValList>::Seq; // reconstruct a type-seq from a type-list
|
using ValTypes = Types<ValList>::Seq; // reconstruct a type-seq from a type-list
|
||||||
|
|
||||||
enum { ARG_CNT = count<ArgsList>()
|
enum { ARG_CNT = count<ArgsList>()
|
||||||
, VAL_CNT = count<ValList>()
|
, VAL_CNT = count<ValList>()
|
||||||
|
|
@ -303,34 +303,34 @@ namespace func{
|
||||||
|
|
||||||
|
|
||||||
// create list of the *remaining* arguments, after applying the ValList
|
// create list of the *remaining* arguments, after applying the ValList
|
||||||
using LeftReduced = typename Splice<ArgsList, ValList>::Back;
|
using LeftReduced = Splice<ArgsList, ValList>::Back;
|
||||||
using RightReduced = typename Splice<ArgsList, ValList, ROFFSET>::Front;
|
using RightReduced = Splice<ArgsList, ValList, ROFFSET>::Front;
|
||||||
|
|
||||||
using ArgsL = typename Types<LeftReduced>::Seq;
|
using ArgsL = Types<LeftReduced>::Seq;
|
||||||
using ArgsR = typename Types<RightReduced>::Seq;
|
using ArgsR = Types<RightReduced>::Seq;
|
||||||
|
|
||||||
|
|
||||||
// build a list, where each of the *remaining* arguments is replaced by a placeholder marker
|
// build a list, where each of the *remaining* arguments is replaced by a placeholder marker
|
||||||
using TrailingPlaceholders = typename func::PlaceholderTuple<LeftReduced>::List;
|
using TrailingPlaceholders = func::PlaceholderTuple<LeftReduced>::List;
|
||||||
using LeadingPlaceholders = typename func::PlaceholderTuple<RightReduced>::List;
|
using LeadingPlaceholders = func::PlaceholderTuple<RightReduced>::List;
|
||||||
|
|
||||||
// ... and splice these placeholders on top of the original argument type list,
|
// ... and splice these placeholders on top of the original argument type list,
|
||||||
// thus retaining the types to be closed, but setting a placeholder for each remaining argument
|
// thus retaining the types to be closed, but setting a placeholder for each remaining argument
|
||||||
using LeftReplaced = typename Splice<ArgsList, TrailingPlaceholders, VAL_CNT>::List;
|
using LeftReplaced = Splice<ArgsList, TrailingPlaceholders, VAL_CNT>::List;
|
||||||
using RightReplaced = typename Splice<ArgsList, LeadingPlaceholders, 0 >::List;
|
using RightReplaced = Splice<ArgsList, LeadingPlaceholders, 0 >::List;
|
||||||
|
|
||||||
using LeftReplacedTypes = typename Types<LeftReplaced>::Seq;
|
using LeftReplacedTypes = Types<LeftReplaced>::Seq;
|
||||||
using RightReplacedTypes = typename Types<RightReplaced>::Seq;
|
using RightReplacedTypes = Types<RightReplaced>::Seq;
|
||||||
|
|
||||||
// create a "builder" helper, which accepts exactly the value tuple elements
|
// create a "builder" helper, which accepts exactly the value tuple elements
|
||||||
// and puts them at the right location, while default-constructing the remaining
|
// and puts them at the right location, while default-constructing the remaining
|
||||||
// (=placeholder)-arguments. Using this builder helper, we can finally set up
|
// (=placeholder)-arguments. Using this builder helper, we can finally set up
|
||||||
// the argument tuples (Left/RightReplacedArgs) used for the std::bind call
|
// the argument tuples (Left/RightReplacedArgs) used for the std::bind call
|
||||||
template<class SRC, class TAR, size_t i>
|
template<class SRC, class TAR, size_t i>
|
||||||
using IdxSelectorL = typename PartiallyInitTuple<SRC, TAR, 0>::template IndexMapper<i>;
|
using IdxSelectorL = PartiallyInitTuple<SRC, TAR, 0>::template IndexMapper<i>;
|
||||||
|
|
||||||
template<class SRC, class TAR, size_t i>
|
template<class SRC, class TAR, size_t i>
|
||||||
using IdxSelectorR = typename PartiallyInitTuple<SRC, TAR, ROFFSET>::template IndexMapper<i>;
|
using IdxSelectorR = PartiallyInitTuple<SRC, TAR, ROFFSET>::template IndexMapper<i>;
|
||||||
|
|
||||||
using BuildL = TupleConstructor<LeftReplacedTypes, IdxSelectorL>;
|
using BuildL = TupleConstructor<LeftReplacedTypes, IdxSelectorL>;
|
||||||
using BuildR = TupleConstructor<RightReplacedTypes, IdxSelectorR>;
|
using BuildR = TupleConstructor<RightReplacedTypes, IdxSelectorR>;
|
||||||
|
|
@ -404,31 +404,31 @@ namespace func{
|
||||||
template<typename SIG, typename X, uint pos>
|
template<typename SIG, typename X, uint pos>
|
||||||
class BindToArgument
|
class BindToArgument
|
||||||
{
|
{
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using Ret = typename _Fun<SIG>::Ret;
|
using Ret = _Fun<SIG>::Ret;
|
||||||
using ArgsList = typename Args::List;
|
using ArgsList = Args::List;
|
||||||
using ValList = typename Types<X>::List;
|
using ValList = Types<X>::List;
|
||||||
|
|
||||||
enum { ARG_CNT = count<ArgsList>() };
|
enum { ARG_CNT = count<ArgsList>() };
|
||||||
|
|
||||||
using RemainingFront = typename Splice<ArgsList, ValList, pos>::Front;
|
using RemainingFront = Splice<ArgsList, ValList, pos>::Front;
|
||||||
using RemainingBack = typename Splice<ArgsList, ValList, pos>::Back;
|
using RemainingBack = Splice<ArgsList, ValList, pos>::Back;
|
||||||
using PlaceholdersBefore = typename func::PlaceholderTuple<RemainingFront>::List;
|
using PlaceholdersBefore = func::PlaceholderTuple<RemainingFront>::List;
|
||||||
using PlaceholdersBehind = typename func::PlaceholderTuple<RemainingBack,pos+1>::List;
|
using PlaceholdersBehind = func::PlaceholderTuple<RemainingBack,pos+1>::List;
|
||||||
|
|
||||||
using PreparedArgsRaw = typename Append<typename Append<PlaceholdersBefore // arguments before the splice: passed-through
|
using PreparedArgsRaw = typename Append<typename Append<PlaceholdersBefore // arguments before the splice: passed-through
|
||||||
,ValList >::List // splice in the value tuple
|
,ValList >::List // splice in the value tuple
|
||||||
,PlaceholdersBehind // arguments behind the splice: passed-through
|
,PlaceholdersBehind // arguments behind the splice: passed-through
|
||||||
>::List;
|
>::List;
|
||||||
using PreparedArgs = Prefix<PreparedArgsRaw, ARG_CNT>;
|
using PreparedArgs = Prefix<PreparedArgsRaw, ARG_CNT>;
|
||||||
using ReducedArgs = typename Append<RemainingFront, RemainingBack>::List;
|
using ReducedArgs = Append<RemainingFront, RemainingBack>::List;
|
||||||
|
|
||||||
using PreparedArgTypes = typename Types<PreparedArgs>::Seq;
|
using PreparedArgTypes = Types<PreparedArgs>::Seq;
|
||||||
using RemainingArgs = typename Types<ReducedArgs>::Seq;
|
using RemainingArgs = Types<ReducedArgs>::Seq;
|
||||||
|
|
||||||
|
|
||||||
template<class SRC, class TAR, size_t i>
|
template<class SRC, class TAR, size_t i>
|
||||||
using IdxSelector = typename PartiallyInitTuple<SRC, TAR, pos>::template IndexMapper<i>;
|
using IdxSelector = PartiallyInitTuple<SRC, TAR, pos>::template IndexMapper<i>;
|
||||||
|
|
||||||
using BuildPreparedArgs = TupleConstructor<PreparedArgTypes, IdxSelector>;
|
using BuildPreparedArgs = TupleConstructor<PreparedArgTypes, IdxSelector>;
|
||||||
|
|
||||||
|
|
@ -461,10 +461,10 @@ namespace func{
|
||||||
template<typename FUN1, typename FUN2>
|
template<typename FUN1, typename FUN2>
|
||||||
struct _Chain
|
struct _Chain
|
||||||
{
|
{
|
||||||
using Ret = typename _Fun<FUN2>::Ret;
|
using Ret = _Fun<FUN2>::Ret;
|
||||||
using Args = typename _Fun<FUN1>::Args;
|
using Args = _Fun<FUN1>::Args;
|
||||||
|
|
||||||
using FunType = typename BuildFunType<Ret,Args>::Fun;
|
using FunType = BuildFunType<Ret,Args>::Fun;
|
||||||
static auto adaptedFunType() { return FunType{}; }
|
static auto adaptedFunType() { return FunType{}; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ namespace meta{
|
||||||
|
|
||||||
/** abbreviation for referring to a function's return type */
|
/** abbreviation for referring to a function's return type */
|
||||||
template<typename FUN>
|
template<typename FUN>
|
||||||
using _FunRet = typename _Fun<FUN>::Ret;
|
using _FunRet = _Fun<FUN>::Ret;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<typename FUN>
|
template<typename FUN>
|
||||||
|
|
@ -259,14 +259,14 @@ namespace meta{
|
||||||
static_assert(_Fun<FUN>() , "something funktion-like required");
|
static_assert(_Fun<FUN>() , "something funktion-like required");
|
||||||
static_assert(_Fun<FUN>::ARITY == 1 , "function with exactly one argument required");
|
static_assert(_Fun<FUN>::ARITY == 1 , "function with exactly one argument required");
|
||||||
|
|
||||||
using Sig = typename _Fun<FUN>::Sig;
|
using Sig = _Fun<FUN>::Sig;
|
||||||
using Arg = typename _Fun<Sig>::Args::List::Head;
|
using Arg = _Fun<Sig>::Args::List::Head;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** abbreviation for referring to a function's single Argument type */
|
/** abbreviation for referring to a function's single Argument type */
|
||||||
template<typename FUN>
|
template<typename FUN>
|
||||||
using _FunArg = typename _DetectSingleArgFunction<FUN>::Arg;
|
using _FunArg = _DetectSingleArgFunction<FUN>::Arg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ namespace meta {
|
||||||
* reference to an anonymous temporary.
|
* reference to an anonymous temporary.
|
||||||
*/
|
*/
|
||||||
template<typename X>
|
template<typename X>
|
||||||
typename Unwrap<X>::Type&
|
Unwrap<X>::Type&
|
||||||
unwrap (X const& wrapped)
|
unwrap (X const& wrapped)
|
||||||
{
|
{
|
||||||
return Unwrap<X>::extract(wrapped);
|
return Unwrap<X>::extract(wrapped);
|
||||||
|
|
@ -258,7 +258,7 @@ namespace meta {
|
||||||
using TypePointee = remove_pointer_t<TypeReferred>;
|
using TypePointee = remove_pointer_t<TypeReferred>;
|
||||||
using TypePlain = remove_cv_t<TypePointee>;
|
using TypePlain = remove_cv_t<TypePointee>;
|
||||||
|
|
||||||
using Type = typename Unwrap<TypePlain>::Type;
|
using Type = Unwrap<TypePlain>::Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -509,7 +509,7 @@ namespace meta {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class can_IterForEach
|
class can_IterForEach
|
||||||
{
|
{
|
||||||
using Type = typename Strip<T>::Type;
|
using Type = Strip<T>::Type;
|
||||||
|
|
||||||
META_DETECT_NESTED(value_type);
|
META_DETECT_NESTED(value_type);
|
||||||
META_DETECT_OPERATOR_DEREF();
|
META_DETECT_OPERATOR_DEREF();
|
||||||
|
|
@ -533,7 +533,7 @@ namespace meta {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class is_StateCore
|
class is_StateCore
|
||||||
{
|
{
|
||||||
using Type = typename Strip<T>::Type;
|
using Type = Strip<T>::Type;
|
||||||
|
|
||||||
META_DETECT_FUNCTION_ARGLESS(checkPoint);
|
META_DETECT_FUNCTION_ARGLESS(checkPoint);
|
||||||
META_DETECT_FUNCTION_ARGLESS(iterNext);
|
META_DETECT_FUNCTION_ARGLESS(iterNext);
|
||||||
|
|
@ -554,7 +554,7 @@ namespace meta {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class can_STL_ForEach
|
class can_STL_ForEach
|
||||||
{
|
{
|
||||||
using Type = typename Strip<T>::Type;
|
using Type = Strip<T>::Type;
|
||||||
|
|
||||||
struct is_iterable
|
struct is_iterable
|
||||||
{
|
{
|
||||||
|
|
@ -618,7 +618,7 @@ namespace meta {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class can_STL_backIteration
|
class can_STL_backIteration
|
||||||
{
|
{
|
||||||
using Type = typename Strip<T>::Type;
|
using Type = Strip<T>::Type;
|
||||||
|
|
||||||
struct is_backIterable
|
struct is_backIterable
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,8 @@ namespace meta{
|
||||||
static auto
|
static auto
|
||||||
wrapBuilder (CLO closureFun) ///< need to provide the remaining arguments as a tuple
|
wrapBuilder (CLO closureFun) ///< need to provide the remaining arguments as a tuple
|
||||||
{
|
{
|
||||||
using RemainingArgs = typename _Fun<CLO>::Args;
|
using RemainingArgs = _Fun<CLO>::Args;
|
||||||
using RemainingParams = typename lib::meta::RebindVariadic<TUP, RemainingArgs>::Type;
|
using RemainingParams = lib::meta::RebindVariadic<TUP, RemainingArgs>::Type;
|
||||||
|
|
||||||
struct Wrap
|
struct Wrap
|
||||||
{
|
{
|
||||||
|
|
@ -186,13 +186,13 @@ namespace meta{
|
||||||
template<typename T, size_t N>
|
template<typename T, size_t N>
|
||||||
struct _Adapt
|
struct _Adapt
|
||||||
{
|
{
|
||||||
using NFold = typename Repeat<T,N>::Seq;
|
using NFold = Repeat<T,N>::Seq;
|
||||||
using Array = typename RebindVariadic<ArrayAdapt, NFold>::Type;
|
using Array = RebindVariadic<ArrayAdapt, NFold>::Type;
|
||||||
static_assert(N,"attempt to partially close empty array");
|
static_assert(N,"attempt to partially close empty array");
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, size_t N>
|
template<typename T, size_t N>
|
||||||
using _AdaptArray_t = typename _Adapt<T,N>::Array;
|
using _AdaptArray_t = _Adapt<T,N>::Array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @note adding seamless conversion and compount-init */
|
/** @note adding seamless conversion and compount-init */
|
||||||
|
|
|
||||||
|
|
@ -179,17 +179,17 @@ namespace meta {
|
||||||
struct _InvokeMetafunTup
|
struct _InvokeMetafunTup
|
||||||
{
|
{
|
||||||
using Tupl = std::decay_t<TUP>;
|
using Tupl = std::decay_t<TUP>;
|
||||||
using Elms = typename ElmTypes<Tupl>::Seq;
|
using Elms = ElmTypes<Tupl>::Seq;
|
||||||
using Args = typename Prepend<FUN, Elms>::Seq;
|
using Args = Prepend<FUN, Elms>::Seq;
|
||||||
using Type = typename RebindVariadic<META, Args>::Type;
|
using Type = RebindVariadic<META, Args>::Type;
|
||||||
};
|
};
|
||||||
template<template<typename...> class META, class FUN, class TUP>
|
template<template<typename...> class META, class FUN, class TUP>
|
||||||
struct _InvokeMetafunTup<META, FUN, TUP&>
|
struct _InvokeMetafunTup<META, FUN, TUP&>
|
||||||
{
|
{
|
||||||
using Tupl = std::decay_t<TUP>;
|
using Tupl = std::decay_t<TUP>;
|
||||||
using Elms = typename ElmTypes<Tupl>::Apply<std::add_lvalue_reference_t>;
|
using Elms = typename ElmTypes<Tupl>::template Apply<std::add_lvalue_reference_t>;
|
||||||
using Args = typename Prepend<FUN, Elms>::Seq;
|
using Args = Prepend<FUN, Elms>::Seq;
|
||||||
using Type = typename RebindVariadic<META, Args>::Type;
|
using Type = RebindVariadic<META, Args>::Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class FUN, class TUP>
|
template<class FUN, class TUP>
|
||||||
|
|
@ -282,20 +282,20 @@ namespace meta {
|
||||||
static constexpr size_t SIZ = std::tuple_size_v<TUP>;
|
static constexpr size_t SIZ = std::tuple_size_v<TUP>;
|
||||||
|
|
||||||
using Idx = std::make_index_sequence<SIZ>;
|
using Idx = std::make_index_sequence<SIZ>;
|
||||||
using Seq = typename Extract<Idx>::ElmTypes;
|
using Seq = Extract<Idx>::ElmTypes;
|
||||||
using Tup = typename RebindVariadic<std::tuple, Seq>::Type;
|
using Tup = RebindVariadic<std::tuple, Seq>::Type;
|
||||||
|
|
||||||
template<template<class> class META>
|
template<template<class> class META>
|
||||||
using Apply = typename ElmTypes<Seq>::template Apply<META>;
|
using Apply = ElmTypes<Seq>::template Apply<META>;
|
||||||
|
|
||||||
template<template<typename...> class O>
|
template<template<typename...> class O>
|
||||||
using Rebind = typename RebindVariadic<O, Seq>::Type;
|
using Rebind = RebindVariadic<O, Seq>::Type;
|
||||||
|
|
||||||
template<template<class> class PRED>
|
template<template<class> class PRED>
|
||||||
using AndAll = typename ElmTypes<Apply<PRED>>::template Rebind<std::__and_>;
|
using AndAll = ElmTypes<Apply<PRED>>::template Rebind<std::__and_>;
|
||||||
|
|
||||||
template<template<class> class PRED>
|
template<template<class> class PRED>
|
||||||
using OrAll = typename ElmTypes<Apply<PRED>>::template Rebind<std::__or_>;
|
using OrAll = ElmTypes<Apply<PRED>>::template Rebind<std::__or_>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -318,8 +318,8 @@ namespace meta {
|
||||||
template<class H, typename TAIL>
|
template<class H, typename TAIL>
|
||||||
struct BuildTupleType<Node<H, TAIL>>
|
struct BuildTupleType<Node<H, TAIL>>
|
||||||
{
|
{
|
||||||
using Seq = typename Types<Node<H,TAIL>>::Seq;
|
using Seq = Types<Node<H,TAIL>>::Seq;
|
||||||
using Type = typename BuildTupleType<Seq>::Type;
|
using Type = BuildTupleType<Seq>::Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
@ -339,7 +339,7 @@ namespace meta {
|
||||||
* over clever re-use of existing types.
|
* over clever re-use of existing types.
|
||||||
*/
|
*/
|
||||||
template<typename TYPES>
|
template<typename TYPES>
|
||||||
using Tuple = typename BuildTupleType<TYPES>::Type;
|
using Tuple = BuildTupleType<TYPES>::Type;
|
||||||
|
|
||||||
|
|
||||||
using std::tuple_size;
|
using std::tuple_size;
|
||||||
|
|
@ -351,14 +351,14 @@ namespace meta {
|
||||||
template<typename...TYPES>
|
template<typename...TYPES>
|
||||||
struct RebindTupleTypes
|
struct RebindTupleTypes
|
||||||
{
|
{
|
||||||
using Seq = typename Types<TYPES...>::Seq;
|
using Seq = Types<TYPES...>::Seq;
|
||||||
using List = typename Seq::List;
|
using List = Seq::List;
|
||||||
};
|
};
|
||||||
template<typename...TYPES>
|
template<typename...TYPES>
|
||||||
struct RebindTupleTypes<std::tuple<TYPES...>>
|
struct RebindTupleTypes<std::tuple<TYPES...>>
|
||||||
{
|
{
|
||||||
using Seq = typename Types<TYPES...>::Seq;
|
using Seq = Types<TYPES...>::Seq;
|
||||||
using List = typename Seq::List;
|
using List = Seq::List;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -396,7 +396,7 @@ namespace meta {
|
||||||
: Tuple<TYPES>
|
: Tuple<TYPES>
|
||||||
{
|
{
|
||||||
/** meta-sequence to drive instantiation of the ElmMapper */
|
/** meta-sequence to drive instantiation of the ElmMapper */
|
||||||
using SequenceIterator = typename BuildIdxIter<TYPES>::Ascending;
|
using SequenceIterator = BuildIdxIter<TYPES>::Ascending;
|
||||||
|
|
||||||
template<size_t idx, class SRC>
|
template<size_t idx, class SRC>
|
||||||
static auto
|
static auto
|
||||||
|
|
@ -436,7 +436,7 @@ namespace meta {
|
||||||
|
|
||||||
|
|
||||||
template<class SRC, class TAR, size_t i>
|
template<class SRC, class TAR, size_t i>
|
||||||
using ExtractArg = typename ElementExtractor<SRC, TAR>::template Access<i>;
|
using ExtractArg = ElementExtractor<SRC, TAR>::template Access<i>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -489,10 +489,10 @@ namespace meta {
|
||||||
class BuildTupleAccessor
|
class BuildTupleAccessor
|
||||||
{
|
{
|
||||||
// prepare recursion...
|
// prepare recursion...
|
||||||
using Head = typename Split<TYPES>::Head;
|
using Head = Split<TYPES>::Head;
|
||||||
using Tail = typename Split<TYPES>::Tail;
|
using Tail = Split<TYPES>::Tail;
|
||||||
using NextBuilder = BuildTupleAccessor<_X_, Tail,TUP, i+1>;
|
using NextBuilder = BuildTupleAccessor<_X_, Tail,TUP, i+1>;
|
||||||
using NextAccessor = typename NextBuilder::Product;
|
using NextAccessor = NextBuilder::Product;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** type of the product created by this template.
|
/** type of the product created by this template.
|
||||||
|
|
@ -575,7 +575,7 @@ namespace meta {
|
||||||
dump (std::tuple<TYPES...> const& tuple)
|
dump (std::tuple<TYPES...> const& tuple)
|
||||||
{
|
{
|
||||||
using BuildAccessor = BuildTupleAccessor<TupleElementDisplayer, Types<TYPES...>>;
|
using BuildAccessor = BuildTupleAccessor<TupleElementDisplayer, Types<TYPES...>>;
|
||||||
using Displayer = typename BuildAccessor::Product ;
|
using Displayer = BuildAccessor::Product ;
|
||||||
|
|
||||||
return static_cast<Displayer const&> (tuple)
|
return static_cast<Displayer const&> (tuple)
|
||||||
.dump();
|
.dump();
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ namespace meta {
|
||||||
>
|
>
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
using SupportedSourceTypes = typename Filter<DataValues::List, allow_Conversion>::List;
|
using SupportedSourceTypes = Filter<DataValues::List, allow_Conversion>::List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ namespace meta {
|
||||||
struct ElementExtractor<lib::diff::Rec, std::tuple<TYPES...>>
|
struct ElementExtractor<lib::diff::Rec, std::tuple<TYPES...>>
|
||||||
{
|
{
|
||||||
template<size_t i>
|
template<size_t i>
|
||||||
using TargetType = typename Pick<Types<TYPES...>, i>::Type;
|
using TargetType = Pick<Types<TYPES...>, i>::Type;
|
||||||
|
|
||||||
|
|
||||||
template<size_t i>
|
template<size_t i>
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ namespace meta {
|
||||||
template<class TY, class TYPES, size_t i>
|
template<class TY, class TYPES, size_t i>
|
||||||
struct Pick<Node<TY,TYPES>, i>
|
struct Pick<Node<TY,TYPES>, i>
|
||||||
{
|
{
|
||||||
using Type = typename Pick<TYPES, i-1>::Type;
|
using Type = Pick<TYPES, i-1>::Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@ namespace meta {
|
||||||
template< class TY, class TYPES
|
template< class TY, class TYPES
|
||||||
, template<class> class _P_
|
, template<class> class _P_
|
||||||
>
|
>
|
||||||
struct Filter<Node<TY,TYPES>,_P_> { using List = typename CondNode< _P_<TY>::value
|
struct Filter<Node<TY,TYPES>,_P_> { using List = CondNode< _P_<TY>::value
|
||||||
, TY
|
, TY
|
||||||
, typename Filter<TYPES,_P_>::List
|
, typename Filter<TYPES,_P_>::List
|
||||||
>::Next
|
>::Next
|
||||||
|
|
@ -157,8 +157,8 @@ namespace meta {
|
||||||
using List = Nil; };
|
using List = Nil; };
|
||||||
|
|
||||||
template<class TY, class TYPES>
|
template<class TY, class TYPES>
|
||||||
struct PickLast<Node<TY,TYPES>> { using Type = typename PickLast<TYPES>::Type;
|
struct PickLast<Node<TY,TYPES>> { using Type = PickLast<TYPES>::Type;
|
||||||
using List = typename Append< TY
|
using List = Append< TY
|
||||||
, typename PickLast<TYPES>::List
|
, typename PickLast<TYPES>::List
|
||||||
>::List
|
>::List
|
||||||
; };
|
; };
|
||||||
|
|
@ -203,11 +203,11 @@ namespace meta {
|
||||||
|
|
||||||
/** extract prefix of given length */
|
/** extract prefix of given length */
|
||||||
template<class LI, uint l>
|
template<class LI, uint l>
|
||||||
using Prefix = typename Splice<LI, Nil, l>::Front;
|
using Prefix = Splice<LI, Nil, l>::Front;
|
||||||
|
|
||||||
/** extract suffix starting at given pos */
|
/** extract suffix starting at given pos */
|
||||||
template<class LI, uint p>
|
template<class LI, uint p>
|
||||||
using Suffix = typename Splice<LI, Nil, p>::Back;
|
using Suffix = Splice<LI, Nil, p>::Back;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -226,8 +226,8 @@ namespace meta {
|
||||||
using Head = T; ///< first element
|
using Head = T; ///< first element
|
||||||
using First = Node<T,Nil>; ///< a list containing the first element
|
using First = Node<T,Nil>; ///< a list containing the first element
|
||||||
using Tail = TYPES; ///< remainder of the list starting with the second elm.
|
using Tail = TYPES; ///< remainder of the list starting with the second elm.
|
||||||
using Prefix = typename PickLast<List>::List; ///< all of the list, up to but excluding the last element
|
using Prefix = PickLast<List>::List; ///< all of the list, up to but excluding the last element
|
||||||
using End = typename PickLast<List>::Type; ///< the last element
|
using End = PickLast<List>::Type; ///< the last element
|
||||||
using Last = Node<End,Nil>; ///< a list containing the last element
|
using Last = Node<End,Nil>; ///< a list containing the last element
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -276,7 +276,7 @@ namespace meta {
|
||||||
* sources, i.e. the Cartesian product.
|
* sources, i.e. the Cartesian product.
|
||||||
*/
|
*/
|
||||||
template<class TY1,class TY2>
|
template<class TY1,class TY2>
|
||||||
struct Distribute { using List = typename PrefixAll<TY1,TY2>::List; };
|
struct Distribute { using List = PrefixAll<TY1,TY2>::List; };
|
||||||
|
|
||||||
template<class TY>
|
template<class TY>
|
||||||
struct Distribute<Nil,TY> { using List = Nil; };
|
struct Distribute<Nil,TY> { using List = Nil; };
|
||||||
|
|
@ -284,7 +284,7 @@ namespace meta {
|
||||||
template< class TY, class TYPES
|
template< class TY, class TYPES
|
||||||
, class TAIL
|
, class TAIL
|
||||||
>
|
>
|
||||||
struct Distribute<Node<TY,TYPES>,TAIL> { using List = typename Append< typename PrefixAll<TY,TAIL>::List
|
struct Distribute<Node<TY,TYPES>,TAIL> { using List = Append< typename PrefixAll<TY,TAIL>::List
|
||||||
, typename Distribute<TYPES,TAIL>::List
|
, typename Distribute<TYPES,TAIL>::List
|
||||||
>::List
|
>::List
|
||||||
; };
|
; };
|
||||||
|
|
@ -306,7 +306,7 @@ namespace meta {
|
||||||
*/
|
*/
|
||||||
template< class X
|
template< class X
|
||||||
, template<class> class _ENUM_>
|
, template<class> class _ENUM_>
|
||||||
struct Combine { using List = typename Distribute< typename _ENUM_<X>::List
|
struct Combine { using List = Distribute< typename _ENUM_<X>::List
|
||||||
, NilNode
|
, NilNode
|
||||||
>::List; };
|
>::List; };
|
||||||
template< template<class> class _ENUM_>
|
template< template<class> class _ENUM_>
|
||||||
|
|
@ -314,7 +314,7 @@ namespace meta {
|
||||||
|
|
||||||
template< class TY, class TYPES
|
template< class TY, class TYPES
|
||||||
, template<class> class _ENUM_>
|
, template<class> class _ENUM_>
|
||||||
struct Combine<Node<TY,TYPES>,_ENUM_> { using List = typename Distribute< typename _ENUM_<TY>::List
|
struct Combine<Node<TY,TYPES>,_ENUM_> { using List = Distribute< typename _ENUM_<TY>::List
|
||||||
, typename Combine<TYPES,_ENUM_>::List
|
, typename Combine<TYPES,_ENUM_>::List
|
||||||
>::List; };
|
>::List; };
|
||||||
|
|
||||||
|
|
@ -334,7 +334,7 @@ namespace meta {
|
||||||
template<class FLAGS>
|
template<class FLAGS>
|
||||||
struct CombineFlags
|
struct CombineFlags
|
||||||
{
|
{
|
||||||
using List = typename Combine<FLAGS, FlagOnOff>::List;
|
using List = Combine<FLAGS, FlagOnOff>::List;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ namespace meta {
|
||||||
struct Prepend<T, Types<TYPES...>>
|
struct Prepend<T, Types<TYPES...>>
|
||||||
{
|
{
|
||||||
using Seq = Types<T, TYPES...>;
|
using Seq = Types<T, TYPES...>;
|
||||||
using List = typename Types<T, TYPES...>::List;
|
using List = Types<T, TYPES...>::List;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -108,7 +108,7 @@ namespace meta {
|
||||||
struct Types< Node<H,T> >
|
struct Types< Node<H,T> >
|
||||||
{
|
{
|
||||||
using List = Node<H,T>;
|
using List = Node<H,T>;
|
||||||
using Seq = typename Prepend< H
|
using Seq = Prepend< H
|
||||||
, typename Types<T>::Seq
|
, typename Types<T>::Seq
|
||||||
>::Seq;
|
>::Seq;
|
||||||
};
|
};
|
||||||
|
|
@ -135,7 +135,7 @@ namespace meta {
|
||||||
template<typename T1, typename...TS>
|
template<typename T1, typename...TS>
|
||||||
struct Split<Types<T1,TS...> >
|
struct Split<Types<T1,TS...> >
|
||||||
{
|
{
|
||||||
using List = typename Types<T1,TS...>::List;
|
using List = Types<T1,TS...>::List;
|
||||||
|
|
||||||
using Head = T1;
|
using Head = T1;
|
||||||
using First = Types<T1>;
|
using First = Types<T1>;
|
||||||
|
|
@ -143,11 +143,11 @@ namespace meta {
|
||||||
|
|
||||||
// for finding the end we need the help of typelist-util.hpp
|
// for finding the end we need the help of typelist-util.hpp
|
||||||
|
|
||||||
using PrefixList = typename PickLast<List>::List;
|
using PrefixList = PickLast<List>::List;
|
||||||
using TailList = typename Tail::List;
|
using TailList = Tail::List;
|
||||||
|
|
||||||
using Prefix = typename Types<PrefixList>::Seq;
|
using Prefix = Types<PrefixList>::Seq;
|
||||||
using End = typename PickLast<List>::Type;
|
using End = PickLast<List>::Type;
|
||||||
using Last = Types<End>;
|
using Last = Types<End>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -180,17 +180,17 @@ namespace meta {
|
||||||
template<class TYPES, uint i=1>
|
template<class TYPES, uint i=1>
|
||||||
class Shifted
|
class Shifted
|
||||||
{
|
{
|
||||||
using Tail = typename Split<TYPES>::Tail;
|
using Tail = Split<TYPES>::Tail;
|
||||||
public:
|
public:
|
||||||
using Type = typename Shifted<Tail,i-1>::Type;
|
using Type = Shifted<Tail,i-1>::Type;
|
||||||
using Head = typename Split<Type>::Head;
|
using Head = Split<Type>::Head;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class TYPES>
|
template<class TYPES>
|
||||||
struct Shifted<TYPES,0>
|
struct Shifted<TYPES,0>
|
||||||
{
|
{
|
||||||
using Type = TYPES;
|
using Type = TYPES;
|
||||||
using Head = typename Split<Type>::Head; ///< @warning may be Nil in case of an empty list
|
using Head = Split<Type>::Head; ///< @warning may be Nil in case of an empty list
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -202,7 +202,7 @@ namespace meta {
|
||||||
template<typename...TYPES, size_t i>
|
template<typename...TYPES, size_t i>
|
||||||
struct Pick<Types<TYPES...>, i>
|
struct Pick<Types<TYPES...>, i>
|
||||||
{
|
{
|
||||||
using Type = typename Shifted<Types<TYPES...>, i>::Head;
|
using Type = Shifted<Types<TYPES...>, i>::Head;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -214,8 +214,8 @@ namespace meta {
|
||||||
template<typename T, size_t N>
|
template<typename T, size_t N>
|
||||||
struct Repeat
|
struct Repeat
|
||||||
{
|
{
|
||||||
using Rem = typename Repeat<T, N-1>::Seq;
|
using Rem = Repeat<T, N-1>::Seq;
|
||||||
using Seq = typename Prepend<T,Rem>::Seq;
|
using Seq = Prepend<T,Rem>::Seq;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,10 @@ namespace meta {
|
||||||
* @see [std::enable_if](http://en.cppreference.com/w/cpp/types/enable_if)
|
* @see [std::enable_if](http://en.cppreference.com/w/cpp/types/enable_if)
|
||||||
*/
|
*/
|
||||||
template <class Cond, class T = void>
|
template <class Cond, class T = void>
|
||||||
using enable_if = typename enable_if_c<Cond::value, T>::type;
|
using enable_if = enable_if_c<Cond::value, T>::type;
|
||||||
|
|
||||||
template <class Cond, class T = void>
|
template <class Cond, class T = void>
|
||||||
using disable_if = typename enable_if_c<not Cond::value, T>::type;
|
using disable_if = enable_if_c<not Cond::value, T>::type;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -114,9 +114,9 @@ namespace meta {
|
||||||
class _DetectNested_TypeResult
|
class _DetectNested_TypeResult
|
||||||
{
|
{
|
||||||
template<class ZZ>
|
template<class ZZ>
|
||||||
static Yes_t check(typename ZZ::type *);
|
static Yes_t check(ZZ::type *);
|
||||||
template<class X>
|
template<class X>
|
||||||
static Yes_t check(typename X::Type *);
|
static Yes_t check(X::Type *);
|
||||||
template<class>
|
template<class>
|
||||||
static No_t check(...);
|
static No_t check(...);
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ namespace meta {
|
||||||
}
|
}
|
||||||
/** helper to extract the first argument from a variadic arg pack, if any */
|
/** helper to extract the first argument from a variadic arg pack, if any */
|
||||||
template<typename...XS>
|
template<typename...XS>
|
||||||
using extractFirst_t = typename _ExtractFirst<XS...>::Type;
|
using extractFirst_t = _ExtractFirst<XS...>::Type;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ namespace meta {
|
||||||
class is_Typelist
|
class is_Typelist
|
||||||
{
|
{
|
||||||
template<class X>
|
template<class X>
|
||||||
static Yes_t check(typename X::List *);
|
static Yes_t check(X::List *);
|
||||||
template<class>
|
template<class>
|
||||||
static No_t check(...);
|
static No_t check(...);
|
||||||
|
|
||||||
|
|
@ -492,7 +492,7 @@ namespace util {
|
||||||
inline std::string
|
inline std::string
|
||||||
showSmartPtr (SP const& smPtr, std::string label = "smP")
|
showSmartPtr (SP const& smPtr, std::string label = "smP")
|
||||||
{
|
{
|
||||||
using TargetType = typename SP::element_type;
|
using TargetType = SP::element_type;
|
||||||
|
|
||||||
return smPtr? label+"("+showAdr(smPtr.get()) + ") ↗" + StringConv<TargetType>::invoke(*smPtr)
|
return smPtr? label+"("+showAdr(smPtr.get()) + ") ↗" + StringConv<TargetType>::invoke(*smPtr)
|
||||||
: BOTTOM_INDICATOR + " «" + typeStr(smPtr) + "»";
|
: BOTTOM_INDICATOR + " «" + typeStr(smPtr) + "»";
|
||||||
|
|
|
||||||
|
|
@ -107,20 +107,20 @@ namespace meta {
|
||||||
template<typename TY, typename SEL =void>
|
template<typename TY, typename SEL =void>
|
||||||
struct ValueTypeBinding
|
struct ValueTypeBinding
|
||||||
{
|
{
|
||||||
using value_type = typename RefTraits<TY>::Value;
|
using value_type = RefTraits<TY>::Value;
|
||||||
using reference = typename RefTraits<TY>::Reference;
|
using reference = RefTraits<TY>::Reference;
|
||||||
using pointer = typename RefTraits<TY>::Pointer;
|
using pointer = RefTraits<TY>::Pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** specialisation for classes providing STL style type binding definitions */
|
/** specialisation for classes providing STL style type binding definitions */
|
||||||
template<typename TY>
|
template<typename TY>
|
||||||
struct ValueTypeBinding<TY, enable_if<use_ValueTypebindings<TY>> >
|
struct ValueTypeBinding<TY, enable_if<use_ValueTypebindings<TY>> >
|
||||||
{
|
{
|
||||||
using _SrcType = typename RefTraits<TY>::Value;
|
using _SrcType = RefTraits<TY>::Value;
|
||||||
|
|
||||||
using value_type = typename _SrcType::value_type;
|
using value_type = _SrcType::value_type;
|
||||||
using reference = typename _SrcType::reference;
|
using reference = _SrcType::reference;
|
||||||
using pointer = typename _SrcType::pointer;
|
using pointer = _SrcType::pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -159,9 +159,9 @@ namespace meta {
|
||||||
>;
|
>;
|
||||||
|
|
||||||
using ResType = _ValRef;
|
using ResType = _ValRef;
|
||||||
using value_type = typename RefTraits<ResType>::Value;
|
using value_type = RefTraits<ResType>::Value;
|
||||||
using reference = typename RefTraits<ResType>::Reference;
|
using reference = RefTraits<ResType>::Reference;
|
||||||
using pointer = typename RefTraits<ResType>::Pointer;
|
using pointer = RefTraits<ResType>::Pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,20 +70,20 @@ namespace meta {
|
||||||
template<size_t n>
|
template<size_t n>
|
||||||
struct BuildIndexSeq
|
struct BuildIndexSeq
|
||||||
{
|
{
|
||||||
using Ascending = typename BuildIndexSeq<n-1>::Ascending::template AppendElm<n-1>;
|
using Ascending = BuildIndexSeq<n-1>::Ascending::template AppendElm<n-1>;
|
||||||
using Descending = typename BuildIndexSeq<n-1>::Descending::template PrependElm<n-1>;
|
using Descending = BuildIndexSeq<n-1>::Descending::template PrependElm<n-1>;
|
||||||
|
|
||||||
template<size_t d>
|
template<size_t d>
|
||||||
using OffsetBy = typename BuildIndexSeq<n-1>::template OffsetBy<d>::template AppendElm<n-1+d>;
|
using OffsetBy = BuildIndexSeq<n-1>::template OffsetBy<d>::template AppendElm<n-1+d>;
|
||||||
|
|
||||||
template<size_t x>
|
template<size_t x>
|
||||||
using FilledWith = typename BuildIndexSeq<n-1>::template FilledWith<x>::template AppendElm<x>;
|
using FilledWith = BuildIndexSeq<n-1>::template FilledWith<x>::template AppendElm<x>;
|
||||||
|
|
||||||
template<size_t c>
|
template<size_t c>
|
||||||
using First = typename BuildIndexSeq<std::min(c,n)>::Ascending;
|
using First = BuildIndexSeq<std::min(c,n)>::Ascending;
|
||||||
|
|
||||||
template<size_t c>
|
template<size_t c>
|
||||||
using After = typename BuildIndexSeq< (n>c)? n-c : 0>::template OffsetBy<c>;
|
using After = BuildIndexSeq< (n>c)? n-c : 0>::template OffsetBy<c>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
@ -118,20 +118,20 @@ namespace meta {
|
||||||
enum {SIZ = sizeof...(TYPES) };
|
enum {SIZ = sizeof...(TYPES) };
|
||||||
using Builder = BuildIndexSeq<SIZ>;
|
using Builder = BuildIndexSeq<SIZ>;
|
||||||
|
|
||||||
using Ascending = typename Builder::Ascending;
|
using Ascending = Builder::Ascending;
|
||||||
using Descending = typename Builder::Descending;
|
using Descending = Builder::Descending;
|
||||||
|
|
||||||
template<size_t d>
|
template<size_t d>
|
||||||
using OffsetBy = typename Builder::template OffsetBy<d>;
|
using OffsetBy = Builder::template OffsetBy<d>;
|
||||||
|
|
||||||
template<size_t x>
|
template<size_t x>
|
||||||
using FilledWith = typename Builder::template FilledWith<x>;
|
using FilledWith = Builder::template FilledWith<x>;
|
||||||
|
|
||||||
template<size_t c>
|
template<size_t c>
|
||||||
using First = typename Builder::template First<c>;
|
using First = Builder::template First<c>;
|
||||||
|
|
||||||
template<size_t c>
|
template<size_t c>
|
||||||
using After = typename Builder::template After<c>;
|
using After = Builder::template After<c>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** build an index number sequence from a type sequence */
|
/** build an index number sequence from a type sequence */
|
||||||
|
|
@ -193,13 +193,13 @@ namespace meta {
|
||||||
using Apply = Types<META<TYPES>...>;
|
using Apply = Types<META<TYPES>...>;
|
||||||
|
|
||||||
template<template<typename...> class O>
|
template<template<typename...> class O>
|
||||||
using Rebind = typename lib::meta::RebindVariadic<O, Seq>::Type;
|
using Rebind = lib::meta::RebindVariadic<O, Seq>::Type;
|
||||||
|
|
||||||
template<template<class> class PRED>
|
template<template<class> class PRED>
|
||||||
using AndAll = typename ElmTypes<Apply<PRED>>::template Rebind<std::__and_>;
|
using AndAll = ElmTypes<Apply<PRED>>::template Rebind<std::__and_>;
|
||||||
|
|
||||||
template<template<class> class PRED>
|
template<template<class> class PRED>
|
||||||
using OrAll = typename ElmTypes<Apply<PRED>>::template Rebind<std::__or_>;
|
using OrAll = ElmTypes<Apply<PRED>>::template Rebind<std::__or_>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Note: a further specialisation for any »tuple-like« is defined in tuple-helper.hpp
|
// Note: a further specialisation for any »tuple-like« is defined in tuple-helper.hpp
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@
|
||||||
** template<typename...CASES>
|
** template<typename...CASES>
|
||||||
** struct MyModel
|
** struct MyModel
|
||||||
** {
|
** {
|
||||||
** using SubSeq = typename _Vari<MyModel, CASES...>::Prefix;
|
** using SubSeq = _Vari<MyModel, CASES...>::Prefix;
|
||||||
**
|
**
|
||||||
** // adapt a predecessor sequence
|
** // adapt a predecessor sequence
|
||||||
** MyModel (SubSeq&& subModel);
|
** MyModel (SubSeq&& subModel);
|
||||||
**
|
**
|
||||||
**
|
**
|
||||||
** using Tuple = typename RebindVariadic<std::tuple, CASES...>::Type;
|
** using Tuple = RebindVariadic<std::tuple, CASES...>::Type;
|
||||||
** }
|
** }
|
||||||
** \endcode
|
** \endcode
|
||||||
** @see param-weaving-pattern.hpp "usage example"
|
** @see param-weaving-pattern.hpp "usage example"
|
||||||
|
|
@ -138,15 +138,15 @@ namespace meta {
|
||||||
template<template<class...> class L, typename X, typename...XS>
|
template<template<class...> class L, typename X, typename...XS>
|
||||||
struct _Vari<L, X,XS...>
|
struct _Vari<L, X,XS...>
|
||||||
{
|
{
|
||||||
using Penult = typename _Vari<L,XS...>::Penult;
|
using Penult = _Vari<L,XS...>::Penult;
|
||||||
using Ultima = typename _Vari<L,XS...>::Ultima;
|
using Ultima = _Vari<L,XS...>::Ultima;
|
||||||
|
|
||||||
using _Tail_Pre_ = typename _Vari<L,XS...>::Prefix;
|
using _Tail_Pre_ = _Vari<L,XS...>::Prefix;
|
||||||
using _Tail_Rev_ = typename _Vari<L,XS...>::Revers;
|
using _Tail_Rev_ = _Vari<L,XS...>::Revers;
|
||||||
|
|
||||||
using Remain = L<XS...>;
|
using Remain = L<XS...>;
|
||||||
using Prefix = typename _Vari<L, X, _Tail_Pre_>::Prepend;
|
using Prefix = _Vari<L, X, _Tail_Pre_>::Prepend;
|
||||||
using Revers = typename _Vari<L, Ultima, _Tail_Rev_>::Prepend;
|
using Revers = _Vari<L, Ultima, _Tail_Rev_>::Prepend;
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace lib::meta
|
}} // namespace lib::meta
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ namespace lib {
|
||||||
template<typename RAW>
|
template<typename RAW>
|
||||||
struct BuildRefcountPtr
|
struct BuildRefcountPtr
|
||||||
{
|
{
|
||||||
using RawType = typename std::remove_pointer<RAW>::type;
|
using RawType = std::remove_pointer<RAW>::type;
|
||||||
using BareType = RawType *;
|
using BareType = RawType *;
|
||||||
using ResultType = std::shared_ptr<RawType>;
|
using ResultType = std::shared_ptr<RawType>;
|
||||||
|
|
||||||
|
|
@ -210,8 +210,8 @@ namespace lib {
|
||||||
struct FabConfig
|
struct FabConfig
|
||||||
{
|
{
|
||||||
using WrapFunctor = Wrapper<TY>;
|
using WrapFunctor = Wrapper<TY>;
|
||||||
using BareProduct = typename WrapFunctor::BareType;
|
using BareProduct = WrapFunctor::BareType;
|
||||||
using WrappedProduct = typename WrapFunctor::ResultType;
|
using WrappedProduct = WrapFunctor::ResultType;
|
||||||
|
|
||||||
typedef BareProduct SIG_Fab(void);
|
typedef BareProduct SIG_Fab(void);
|
||||||
|
|
||||||
|
|
@ -228,8 +228,8 @@ namespace lib {
|
||||||
struct FabConfig<RET(ARGS...), Wrapper>
|
struct FabConfig<RET(ARGS...), Wrapper>
|
||||||
{
|
{
|
||||||
using WrapFunctor = Wrapper<RET>;
|
using WrapFunctor = Wrapper<RET>;
|
||||||
using BareProduct = typename WrapFunctor::BareType;
|
using BareProduct = WrapFunctor::BareType;
|
||||||
using WrappedProduct = typename WrapFunctor::ResultType;
|
using WrappedProduct = WrapFunctor::ResultType;
|
||||||
|
|
||||||
typedef BareProduct SIG_Fab(ARGS...);
|
typedef BareProduct SIG_Fab(ARGS...);
|
||||||
|
|
||||||
|
|
@ -259,14 +259,14 @@ namespace lib {
|
||||||
: public FabConfig<SIG,Wrapper>::WrapFunctor
|
: public FabConfig<SIG,Wrapper>::WrapFunctor
|
||||||
{
|
{
|
||||||
using _Conf = FabConfig<SIG,Wrapper>;
|
using _Conf = FabConfig<SIG,Wrapper>;
|
||||||
using SIG_Fab = typename _Conf::SIG_Fab;
|
using SIG_Fab = _Conf::SIG_Fab;
|
||||||
using _Fab = Fab<SIG_Fab,ID>;
|
using _Fab = Fab<SIG_Fab,ID>;
|
||||||
|
|
||||||
_Fab funcTable_;
|
_Fab funcTable_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using Creator = typename _Fab::FactoryFunc;
|
using Creator = _Fab::FactoryFunc;
|
||||||
|
|
||||||
Creator&
|
Creator&
|
||||||
selectProducer (ID const& id)
|
selectProducer (ID const& id)
|
||||||
|
|
@ -276,7 +276,7 @@ namespace lib {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Product = typename _Conf::WrappedProduct;
|
using Product = _Conf::WrappedProduct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Core operation of the factory:
|
* Core operation of the factory:
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ namespace lib {
|
||||||
>
|
>
|
||||||
class InPlaceAnyHolder
|
class InPlaceAnyHolder
|
||||||
{
|
{
|
||||||
using BaseP = typename AccessPolicy::Base *;
|
using BaseP = AccessPolicy::Base *;
|
||||||
|
|
||||||
/** Inner capsule managing the contained object (interface) */
|
/** Inner capsule managing the contained object (interface) */
|
||||||
struct Buffer
|
struct Buffer
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ namespace util {
|
||||||
using PFun = FUN;
|
using PFun = FUN;
|
||||||
PFun parse;
|
PFun parse;
|
||||||
|
|
||||||
using Result = typename _Fun<PFun>::Ret::Result;
|
using Result = _Fun<PFun>::Ret::Result;
|
||||||
|
|
||||||
Connex (FUN pFun)
|
Connex (FUN pFun)
|
||||||
: parse{pFun}
|
: parse{pFun}
|
||||||
|
|
@ -281,7 +281,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
buildConnex (Syntax<PAR> const& anchor)
|
buildConnex (Syntax<PAR> const& anchor)
|
||||||
{
|
{
|
||||||
using Con = typename Syntax<PAR>::Connex;
|
using Con = Syntax<PAR>::Connex;
|
||||||
return Con{anchor};
|
return Con{anchor};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,9 +336,9 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
adaptConnex (CON&& connex, BIND&& modelBinding)
|
adaptConnex (CON&& connex, BIND&& modelBinding)
|
||||||
{
|
{
|
||||||
using RX = typename CON::Result;
|
using RX = CON::Result;
|
||||||
using Arg = std::add_rvalue_reference_t<RX>;
|
using Arg = std::add_rvalue_reference_t<RX>;
|
||||||
using AdaptedRes = typename _ProbeFunReturn<Arg,BIND>::Ret;
|
using AdaptedRes = _ProbeFunReturn<Arg,BIND>::Ret;
|
||||||
return Connex{[origConnex = forward<CON>(connex)
|
return Connex{[origConnex = forward<CON>(connex)
|
||||||
,binding = forward<BIND>(modelBinding)
|
,binding = forward<BIND>(modelBinding)
|
||||||
]
|
]
|
||||||
|
|
@ -357,7 +357,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
toStringConnex (CON&& connex, uint part)
|
toStringConnex (CON&& connex, uint part)
|
||||||
{
|
{
|
||||||
using Result = typename CON::Result;
|
using Result = CON::Result;
|
||||||
return Connex([baseConnex = forward<CON>(connex)
|
return Connex([baseConnex = forward<CON>(connex)
|
||||||
,part
|
,part
|
||||||
]
|
]
|
||||||
|
|
@ -442,9 +442,9 @@ namespace util {
|
||||||
|
|
||||||
/* === Builder functions to mark which side of the combinator to pick === */
|
/* === Builder functions to mark which side of the combinator to pick === */
|
||||||
|
|
||||||
using SubSeq = typename _Vari<AltModel, CASES...>::Prefix; ///< a nested sub-model to extend
|
using SubSeq = _Vari<AltModel, CASES...>::Prefix; ///< a nested sub-model to extend
|
||||||
using Penult = typename _Vari<AltModel, CASES...>::Penult; ///< plain value expected for left-branch
|
using Penult = _Vari<AltModel, CASES...>::Penult; ///< plain value expected for left-branch
|
||||||
using Ultima = typename _Vari<AltModel, CASES...>::Ultima; ///< plain value expected for right-branch
|
using Ultima = _Vari<AltModel, CASES...>::Ultima; ///< plain value expected for right-branch
|
||||||
|
|
||||||
static AltModel
|
static AltModel
|
||||||
mark_left (SubSeq&& leftCases)
|
mark_left (SubSeq&& leftCases)
|
||||||
|
|
@ -524,9 +524,9 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
sequenceConnex (C1&& connex1, C2&& connex2)
|
sequenceConnex (C1&& connex1, C2&& connex2)
|
||||||
{
|
{
|
||||||
using R1 = typename decay_t<C1>::Result;
|
using R1 = decay_t<C1>::Result;
|
||||||
using R2 = typename decay_t<C2>::Result;
|
using R2 = decay_t<C2>::Result;
|
||||||
using ProductResult = typename _Join<SeqModel, R1, R2>::Result;
|
using ProductResult = _Join<SeqModel, R1, R2>::Result;
|
||||||
using ProductEval = Eval<ProductResult>;
|
using ProductEval = Eval<ProductResult>;
|
||||||
return Connex{[conL = forward<C1>(connex1)
|
return Connex{[conL = forward<C1>(connex1)
|
||||||
,conR = forward<C2>(connex2)
|
,conR = forward<C2>(connex2)
|
||||||
|
|
@ -558,9 +558,9 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
branchedConnex (C1&& connex1, C2&& connex2)
|
branchedConnex (C1&& connex1, C2&& connex2)
|
||||||
{
|
{
|
||||||
using R1 = typename decay_t<C1>::Result;
|
using R1 = decay_t<C1>::Result;
|
||||||
using R2 = typename decay_t<C2>::Result;
|
using R2 = decay_t<C2>::Result;
|
||||||
using SumResult = typename _Join<AltModel, R1, R2>::Result;
|
using SumResult = _Join<AltModel, R1, R2>::Result;
|
||||||
using SumEval = Eval<SumResult>;
|
using SumEval = Eval<SumResult>;
|
||||||
return Connex{[conL = forward<C1>(connex1)
|
return Connex{[conL = forward<C1>(connex1)
|
||||||
,conR = forward<C2>(connex2)
|
,conR = forward<C2>(connex2)
|
||||||
|
|
@ -595,7 +595,7 @@ namespace util {
|
||||||
,C1&& delimConnex
|
,C1&& delimConnex
|
||||||
,C2&& bodyConnex)
|
,C2&& bodyConnex)
|
||||||
{
|
{
|
||||||
using Res = typename decay_t<C2>::Result;
|
using Res = decay_t<C2>::Result;
|
||||||
using IterResult = IterModel<Res>;
|
using IterResult = IterModel<Res>;
|
||||||
using IterEval = Eval<IterResult>;
|
using IterEval = Eval<IterResult>;
|
||||||
return Connex{[sep = forward<C1>(delimConnex)
|
return Connex{[sep = forward<C1>(delimConnex)
|
||||||
|
|
@ -636,7 +636,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
optionalConnex (CNX&& connex)
|
optionalConnex (CNX&& connex)
|
||||||
{
|
{
|
||||||
using Res = typename decay_t<CNX>::Result;
|
using Res = decay_t<CNX>::Result;
|
||||||
using OptResult = optional<Res>;
|
using OptResult = optional<Res>;
|
||||||
using OptEval = Eval<OptResult>;
|
using OptEval = Eval<OptResult>;
|
||||||
return Connex{[body = forward<CNX>(connex)
|
return Connex{[body = forward<CNX>(connex)
|
||||||
|
|
@ -661,7 +661,7 @@ namespace util {
|
||||||
,C3&& bodyConnex
|
,C3&& bodyConnex
|
||||||
,bool isOptional)
|
,bool isOptional)
|
||||||
{
|
{
|
||||||
using Res = typename decay_t<C3>::Result;
|
using Res = decay_t<C3>::Result;
|
||||||
return Connex{[opening = forward<C1>(openingConnex)
|
return Connex{[opening = forward<C1>(openingConnex)
|
||||||
,closing = forward<C2>(closingConnex)
|
,closing = forward<C2>(closingConnex)
|
||||||
,body = forward<C3>(bodyConnex)
|
,body = forward<C3>(bodyConnex)
|
||||||
|
|
@ -704,12 +704,12 @@ namespace util {
|
||||||
class Parser
|
class Parser
|
||||||
: public CON
|
: public CON
|
||||||
{
|
{
|
||||||
using PFun = typename CON::PFun;
|
using PFun = CON::PFun;
|
||||||
static_assert (_Fun<PFun>(), "Connex must define a parse-function");
|
static_assert (_Fun<PFun>(), "Connex must define a parse-function");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Connex = CON;
|
using Connex = CON;
|
||||||
using Result = typename CON::Result;
|
using Result = CON::Result;
|
||||||
|
|
||||||
static_assert (has_Sig<PFun, Eval<Result>(StrView)>()
|
static_assert (has_Sig<PFun, Eval<Result>(StrView)>()
|
||||||
,"Signature of the parse-function not suitable");
|
,"Signature of the parse-function not suitable");
|
||||||
|
|
@ -785,8 +785,8 @@ namespace util {
|
||||||
PAR parse_;
|
PAR parse_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Connex = typename PAR::Connex;
|
using Connex = PAR::Connex;
|
||||||
using Result = typename PAR::Result;
|
using Result = PAR::Result;
|
||||||
|
|
||||||
Syntax()
|
Syntax()
|
||||||
: parse_{Nil()}
|
: parse_{Nil()}
|
||||||
|
|
@ -826,7 +826,7 @@ namespace util {
|
||||||
Syntax&
|
Syntax&
|
||||||
operator= (Syntax<PX> refSyntax)
|
operator= (Syntax<PX> refSyntax)
|
||||||
{
|
{
|
||||||
using ConX = typename PX::Connex;
|
using ConX = PX::Connex;
|
||||||
ConX& refConnex = refSyntax;
|
ConX& refConnex = refSyntax;
|
||||||
parse_.parse = move(refConnex.parse);
|
parse_.parse = move(refConnex.parse);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
|
|
@ -259,8 +259,8 @@ namespace lib {
|
||||||
template<typename...ARGS>
|
template<typename...ARGS>
|
||||||
struct Split
|
struct Split
|
||||||
{
|
{
|
||||||
using Prefix = typename meta::BuildIndexSeq<chunk_size>::Ascending;
|
using Prefix = meta::BuildIndexSeq<chunk_size>::Ascending;
|
||||||
using Rest = typename meta::BuildIdxIter<ARGS...>::template After<chunk_size>;
|
using Rest = meta::BuildIdxIter<ARGS...>::template After<chunk_size>;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -560,8 +560,8 @@ namespace lib {
|
||||||
{
|
{
|
||||||
if (l.size() != r.size()) return false;
|
if (l.size() != r.size()) return false;
|
||||||
|
|
||||||
typename PathArray<cl>::iterator lp = l.begin();
|
auto lp = l.begin();
|
||||||
typename PathArray<cl>::iterator rp = r.begin();
|
auto rp = r.begin();
|
||||||
while (lp and rp)
|
while (lp and rp)
|
||||||
{
|
{
|
||||||
if (*lp != *rp) return false;
|
if (*lp != *rp) return false;
|
||||||
|
|
|
||||||
|
|
@ -366,8 +366,8 @@ namespace lib {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef polyvalue::Trait<CPY> _Traits;
|
typedef polyvalue::Trait<CPY> _Traits;
|
||||||
typedef typename _Traits::CopyAPI _CopyHandlingAdapter;
|
typedef _Traits::CopyAPI _CopyHandlingAdapter;
|
||||||
typedef typename _Traits::Assignment _AssignmentPolicy; /////////////////TICKET #1197 : confusingly indirect decision logic
|
typedef _Traits::Assignment _AssignmentPolicy; /////////////////TICKET #1197 : confusingly indirect decision logic
|
||||||
enum{
|
enum{
|
||||||
siz = storage + _Traits::ADMIN_OVERHEAD
|
siz = storage + _Traits::ADMIN_OVERHEAD
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -175,11 +175,11 @@ namespace lib {
|
||||||
: public LazyInit<POL>
|
: public LazyInit<POL>
|
||||||
{
|
{
|
||||||
using Lazy = LazyInit<POL>;
|
using Lazy = LazyInit<POL>;
|
||||||
using Disabled = typename Lazy::MarkDisabled;
|
using Disabled = Lazy::MarkDisabled;
|
||||||
|
|
||||||
using Sig = typename _Fun<POL>::Sig;
|
using Sig = _Fun<POL>::Sig;
|
||||||
using Fun = function<Sig>;
|
using Fun = function<Sig>;
|
||||||
using Tar = typename _Fun<POL>::Ret;
|
using Tar = _Fun<POL>::Ret;
|
||||||
|
|
||||||
Tar maxResult_{Tar::maxVal()}; ///< maximum result val actually to produce < max
|
Tar maxResult_{Tar::maxVal()}; ///< maximum result val actually to produce < max
|
||||||
Tar minResult_{Tar::minVal()}; ///< minimum result val actually to produce > min
|
Tar minResult_{Tar::minVal()}; ///< minimum result val actually to produce > min
|
||||||
|
|
@ -363,16 +363,16 @@ namespace lib {
|
||||||
using _Fun = lib::meta::_Fun<FUN>;
|
using _Fun = lib::meta::_Fun<FUN>;
|
||||||
static_assert (_Fun(), "Need something function-like.");
|
static_assert (_Fun(), "Need something function-like.");
|
||||||
|
|
||||||
using Sig = typename _Fun::Sig;
|
using Sig = _Fun::Sig;
|
||||||
using Args = typename _Fun::Args;
|
using Args = _Fun::Args;
|
||||||
using BaseIn = typename lib::meta::_Fun<POL>::Args;
|
using BaseIn = lib::meta::_Fun<POL>::Args;
|
||||||
|
|
||||||
if constexpr (std::is_same_v<Args, BaseIn>)
|
if constexpr (std::is_same_v<Args, BaseIn>)
|
||||||
// function accepts same arguments as this RandomDraw
|
// function accepts same arguments as this RandomDraw
|
||||||
return forward<FUN> (fun); // pass-through directly
|
return forward<FUN> (fun); // pass-through directly
|
||||||
else
|
else
|
||||||
{// attempt to find a custom adaptor via Policy template
|
{// attempt to find a custom adaptor via Policy template
|
||||||
using Adaptor = typename POL::template Adaptor<Sig>;
|
using Adaptor = POL::template Adaptor<Sig>;
|
||||||
return Adaptor::build (forward<FUN> (fun));
|
return Adaptor::build (forward<FUN> (fun));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -392,7 +392,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
static_assert (lib::meta::_Fun<FUN>(), "Need something function-like.");
|
static_assert (lib::meta::_Fun<FUN>(), "Need something function-like.");
|
||||||
|
|
||||||
using Res = typename lib::meta::_Fun<FUN>::Ret;
|
using Res = lib::meta::_Fun<FUN>::Ret;
|
||||||
using lib::meta::func::chained;
|
using lib::meta::func::chained;
|
||||||
using lib::meta::_FunRet;
|
using lib::meta::_FunRet;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ namespace lib {
|
||||||
public:
|
public:
|
||||||
using GEN::GEN;
|
using GEN::GEN;
|
||||||
|
|
||||||
typename GEN::result_type
|
GEN::result_type
|
||||||
operator()()
|
operator()()
|
||||||
{
|
{
|
||||||
if constexpr (GEN::max() < std::numeric_limits<typename GEN::result_type>::max())
|
if constexpr (GEN::max() < std::numeric_limits<typename GEN::result_type>::max())
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void
|
void
|
||||||
operator() (typename ScopedCollection<I,siz>::ElementHolder& storage)
|
operator() (ScopedCollection<I,siz>::ElementHolder& storage)
|
||||||
{
|
{
|
||||||
storage.template create<I>();
|
storage.template create<I>();
|
||||||
}
|
}
|
||||||
|
|
@ -440,7 +440,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void
|
void
|
||||||
operator() (typename ScopedCollection<I,siz>::ElementHolder& storage)
|
operator() (ScopedCollection<I,siz>::ElementHolder& storage)
|
||||||
{
|
{
|
||||||
storage.template create<TY>();
|
storage.template create<TY>();
|
||||||
}
|
}
|
||||||
|
|
@ -461,7 +461,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
IT iter_;
|
IT iter_;
|
||||||
|
|
||||||
using ElementType = typename meta::ValueTypeBinding<IT>::value_type;
|
using ElementType = meta::ValueTypeBinding<IT>::value_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PullFrom (IT source)
|
PullFrom (IT source)
|
||||||
|
|
@ -469,7 +469,7 @@ namespace lib {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void
|
void
|
||||||
operator() (typename ScopedCollection<I,siz>::ElementHolder& storage)
|
operator() (ScopedCollection<I,siz>::ElementHolder& storage)
|
||||||
{
|
{
|
||||||
storage.template create<ElementType> (*iter_);
|
storage.template create<ElementType> (*iter_);
|
||||||
++iter_;
|
++iter_;
|
||||||
|
|
|
||||||
|
|
@ -68,13 +68,13 @@ namespace lib {
|
||||||
: util::MoveAssign
|
: util::MoveAssign
|
||||||
{
|
{
|
||||||
using _Vec = std::vector<T*>;
|
using _Vec = std::vector<T*>;
|
||||||
using VIter = typename _Vec::iterator;
|
using VIter = _Vec::iterator;
|
||||||
|
|
||||||
using RIter = RangeIter<VIter>;
|
using RIter = RangeIter<VIter>;
|
||||||
using IterType = PtrDerefIter<RIter>;
|
using IterType = PtrDerefIter<RIter>;
|
||||||
|
|
||||||
using ConstIterType = typename IterType::ConstIterType;
|
using ConstIterType = IterType::ConstIterType;
|
||||||
using RcIter = typename IterType::WrappedConstIterType;
|
using RcIter = IterType::WrappedConstIterType;
|
||||||
|
|
||||||
_Vec vec_;
|
_Vec vec_;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ namespace lib {
|
||||||
using Bucket = ArrayBucket<I>;
|
using Bucket = ArrayBucket<I>;
|
||||||
|
|
||||||
template<typename X>
|
template<typename X>
|
||||||
using XAlloT = typename AlloT::template rebind_traits<std::remove_cv_t<X>>;
|
using XAlloT = AlloT::template rebind_traits<std::remove_cv_t<X>>;
|
||||||
|
|
||||||
Allo& baseAllocator() { return *this; }
|
Allo& baseAllocator() { return *this; }
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ namespace lib {
|
||||||
auto
|
auto
|
||||||
adaptAllocator()
|
adaptAllocator()
|
||||||
{
|
{
|
||||||
using XAllo = typename XAlloT<X>::allocator_type;
|
using XAllo = XAlloT<X>::allocator_type;
|
||||||
if constexpr (std::is_constructible_v<XAllo, Allo>)
|
if constexpr (std::is_constructible_v<XAllo, Allo>)
|
||||||
return XAllo{baseAllocator()};
|
return XAllo{baseAllocator()};
|
||||||
else
|
else
|
||||||
|
|
@ -401,7 +401,7 @@ namespace lib {
|
||||||
using Policy = POL<I,E>;
|
using Policy = POL<I,E>;
|
||||||
|
|
||||||
using Bucket = several::ArrayBucket<I>;
|
using Bucket = several::ArrayBucket<I>;
|
||||||
using Deleter = typename Bucket::Deleter;
|
using Deleter = Bucket::Deleter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SeveralBuilder() = default;
|
SeveralBuilder() = default;
|
||||||
|
|
@ -477,7 +477,7 @@ namespace lib {
|
||||||
SeveralBuilder&&
|
SeveralBuilder&&
|
||||||
appendAll (std::initializer_list<X> ili)
|
appendAll (std::initializer_list<X> ili)
|
||||||
{
|
{
|
||||||
using Val = typename meta::Strip<X>::TypeReferred;
|
using Val = meta::Strip<X>::TypeReferred;
|
||||||
for (Val const& x : ili)
|
for (Val const& x : ili)
|
||||||
emplaceNewElm<Val> (x);
|
emplaceNewElm<Val> (x);
|
||||||
return move(*this);
|
return move(*this);
|
||||||
|
|
@ -507,7 +507,7 @@ namespace lib {
|
||||||
SeveralBuilder&&
|
SeveralBuilder&&
|
||||||
emplace (ARGS&& ...args)
|
emplace (ARGS&& ...args)
|
||||||
{
|
{
|
||||||
using Val = typename meta::Strip<TY>::TypeReferred;
|
using Val = meta::Strip<TY>::TypeReferred;
|
||||||
emplaceNewElm<Val> (forward<ARGS> (args)...);
|
emplaceNewElm<Val> (forward<ARGS> (args)...);
|
||||||
return move(*this);
|
return move(*this);
|
||||||
}
|
}
|
||||||
|
|
@ -549,7 +549,7 @@ namespace lib {
|
||||||
void
|
void
|
||||||
emplaceCopy (IT& dataSrc)
|
emplaceCopy (IT& dataSrc)
|
||||||
{
|
{
|
||||||
using Val = typename IT::value_type;
|
using Val = IT::value_type;
|
||||||
emplaceNewElm<Val> (*dataSrc);
|
emplaceNewElm<Val> (*dataSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -557,7 +557,7 @@ namespace lib {
|
||||||
void
|
void
|
||||||
emplaceMove (IT& dataSrc)
|
emplaceMove (IT& dataSrc)
|
||||||
{
|
{
|
||||||
using Val = typename IT::value_type;
|
using Val = IT::value_type;
|
||||||
emplaceNewElm<Val> (move (*dataSrc));
|
emplaceNewElm<Val> (move (*dataSrc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -737,9 +737,9 @@ namespace lib {
|
||||||
Deleter
|
Deleter
|
||||||
selectDestructor()
|
selectDestructor()
|
||||||
{
|
{
|
||||||
using IVal = typename lib::meta::Strip<I>::TypeReferred;
|
using IVal = lib::meta::Strip<I>::TypeReferred;
|
||||||
using EVal = typename lib::meta::Strip<E>::TypeReferred;
|
using EVal = lib::meta::Strip<E>::TypeReferred;
|
||||||
using TVal = typename lib::meta::Strip<TY>::TypeReferred;
|
using TVal = lib::meta::Strip<TY>::TypeReferred;
|
||||||
|
|
||||||
typename Policy::Fac& factory(*this);
|
typename Policy::Fac& factory(*this);
|
||||||
|
|
||||||
|
|
@ -783,8 +783,8 @@ namespace lib {
|
||||||
void
|
void
|
||||||
probeMoveCapability()
|
probeMoveCapability()
|
||||||
{
|
{
|
||||||
using TVal = typename lib::meta::Strip<TY>::TypeReferred;
|
using TVal = lib::meta::Strip<TY>::TypeReferred;
|
||||||
using EVal = typename lib::meta::Strip<E>::TypeReferred;
|
using EVal = lib::meta::Strip<E>::TypeReferred;
|
||||||
|
|
||||||
if (not (is_same_v<TVal,EVal> or is_trivially_copyable_v<TVal>))
|
if (not (is_same_v<TVal,EVal> or is_trivially_copyable_v<TVal>))
|
||||||
lock_move = true;
|
lock_move = true;
|
||||||
|
|
@ -793,7 +793,7 @@ namespace lib {
|
||||||
bool
|
bool
|
||||||
canWildMove()
|
canWildMove()
|
||||||
{
|
{
|
||||||
using EVal = typename lib::meta::Strip<E>::TypeReferred;
|
using EVal = lib::meta::Strip<E>::TypeReferred;
|
||||||
return is_trivially_copyable_v<EVal> and not lock_move;
|
return is_trivially_copyable_v<EVal> and not lock_move;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,8 +227,8 @@ namespace lib {
|
||||||
friend auto begin (Several const& svl) { return svl.begin();}
|
friend auto begin (Several const& svl) { return svl.begin();}
|
||||||
friend auto end (Several const& svl) { return svl.end(); }
|
friend auto end (Several const& svl) { return svl.end(); }
|
||||||
|
|
||||||
using value_type = typename meta::RefTraits<I>::Value;
|
using value_type = meta::RefTraits<I>::Value;
|
||||||
using reference = typename meta::RefTraits<I>::Reference;
|
using reference = meta::RefTraits<I>::Reference;
|
||||||
using const_reference = value_type const&;
|
using const_reference = value_type const&;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,7 @@ namespace stat{
|
||||||
% csv.getParsedFieldCnt() % columnCnt % line};
|
% csv.getParsedFieldCnt() % columnCnt % line};
|
||||||
}
|
}
|
||||||
|
|
||||||
using Value = typename std::remove_reference<decltype(col)>::type::ValueType;
|
using Value = std::remove_reference<decltype(col)>::type::ValueType;
|
||||||
col.get() = parseAs<Value>(*csv);
|
col.get() = parseAs<Value>(*csv);
|
||||||
++csv;
|
++csv;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ namespace lib {
|
||||||
class ClassLock
|
class ClassLock
|
||||||
: public Sync<CONF>::Lock
|
: public Sync<CONF>::Lock
|
||||||
{
|
{
|
||||||
using Lock = typename Sync<CONF>::Lock;
|
using Lock = Sync<CONF>::Lock;
|
||||||
using Monitor = typename sync::Monitor<CONF>;
|
using Monitor = sync::Monitor<CONF>;
|
||||||
|
|
||||||
struct PerClassMonitor : Monitor {};
|
struct PerClassMonitor : Monitor {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ namespace microbenchmark {
|
||||||
static_assert (lib::meta::_Fun<FUN>(), "Need something function-like.");
|
static_assert (lib::meta::_Fun<FUN>(), "Need something function-like.");
|
||||||
static_assert (lib::meta::_Fun<FUN>::ARITY <=1, "Function with zero or one argument required.");
|
static_assert (lib::meta::_Fun<FUN>::ARITY <=1, "Function with zero or one argument required.");
|
||||||
|
|
||||||
using Sig = typename lib::meta::_Fun<FUN>::Sig;
|
using Sig = lib::meta::_Fun<FUN>::Sig;
|
||||||
|
|
||||||
return Adaptor<Sig>::wrap (std::forward<FUN> (fun));
|
return Adaptor<Sig>::wrap (std::forward<FUN> (fun));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ namespace test{
|
||||||
showType()
|
showType()
|
||||||
{
|
{
|
||||||
using Case = TypeDiagnostics<X>;
|
using Case = TypeDiagnostics<X>;
|
||||||
using Type = typename Case::Type;
|
using Type = Case::Type;
|
||||||
|
|
||||||
return Case::prefix
|
return Case::prefix
|
||||||
+ meta::humanReadableTypeID (typeid(Type).name())
|
+ meta::humanReadableTypeID (typeid(Type).name())
|
||||||
|
|
|
||||||
|
|
@ -372,10 +372,10 @@ namespace lib {
|
||||||
class InstanceCore
|
class InstanceCore
|
||||||
{
|
{
|
||||||
using ActionIter = IndexIter<const ActionSeq>;
|
using ActionIter = IndexIter<const ActionSeq>;
|
||||||
using DataCtxIter = typename SRC::Iter;
|
using DataCtxIter = SRC::Iter;
|
||||||
using NestedCtx = std::pair<DataCtxIter, SRC>;
|
using NestedCtx = std::pair<DataCtxIter, SRC>;
|
||||||
using CtxStack = std::stack<NestedCtx, std::vector<NestedCtx>>;
|
using CtxStack = std::stack<NestedCtx, std::vector<NestedCtx>>;
|
||||||
using Value = typename SRC::Value;
|
using Value = SRC::Value;
|
||||||
|
|
||||||
SRC dataSrc_;
|
SRC dataSrc_;
|
||||||
ActionIter actionIter_;
|
ActionIter actionIter_;
|
||||||
|
|
@ -826,7 +826,7 @@ namespace lib {
|
||||||
|
|
||||||
/** Instantiate next Action token and expose its rendering */
|
/** Instantiate next Action token and expose its rendering */
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
inline typename SRC::Value
|
inline SRC::Value
|
||||||
TextTemplate::InstanceCore<SRC>::instantiateNext()
|
TextTemplate::InstanceCore<SRC>::instantiateNext()
|
||||||
{
|
{
|
||||||
return actionIter_? actionIter_->instantiate(*this)
|
return actionIter_? actionIter_->instantiate(*this)
|
||||||
|
|
@ -840,7 +840,7 @@ namespace lib {
|
||||||
* @return the rendering produced by the selected next Action token
|
* @return the rendering produced by the selected next Action token
|
||||||
*/
|
*/
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
inline typename SRC::Value
|
inline SRC::Value
|
||||||
TextTemplate::InstanceCore<SRC>::reInstatiate (Idx nextCode)
|
TextTemplate::InstanceCore<SRC>::reInstatiate (Idx nextCode)
|
||||||
{
|
{
|
||||||
if (nextCode == Idx(-1))
|
if (nextCode == Idx(-1))
|
||||||
|
|
@ -852,7 +852,7 @@ namespace lib {
|
||||||
|
|
||||||
/** retrieve a data value from the data source for the indiated key */
|
/** retrieve a data value from the data source for the indiated key */
|
||||||
template<class SRC>
|
template<class SRC>
|
||||||
inline typename SRC::Value
|
inline SRC::Value
|
||||||
TextTemplate::InstanceCore<SRC>::getContent (string key)
|
TextTemplate::InstanceCore<SRC>::getContent (string key)
|
||||||
{
|
{
|
||||||
static Value nil{};
|
static Value nil{};
|
||||||
|
|
|
||||||
|
|
@ -523,13 +523,13 @@ namespace lib {
|
||||||
static_assert(1 == _Fun<FUN>::ARITY);
|
static_assert(1 == _Fun<FUN>::ARITY);
|
||||||
static_assert(1 >= _Fun<HOOK>::ARITY);
|
static_assert(1 >= _Fun<HOOK>::ARITY);
|
||||||
// argument type expected by the hooks down in the policy class
|
// argument type expected by the hooks down in the policy class
|
||||||
using Arg = typename _Fun<FUN>::Args::List::Head;
|
using Arg = _Fun<FUN>::Args::List::Head;
|
||||||
// distinguish if user provided functor takes zero or one argument
|
// distinguish if user provided functor takes zero or one argument
|
||||||
if constexpr (0 == _Fun<HOOK>::ARITY)
|
if constexpr (0 == _Fun<HOOK>::ARITY)
|
||||||
return [hook = forward<HOOK>(hook)](Arg){ hook(); };
|
return [hook = forward<HOOK>(hook)](Arg){ hook(); };
|
||||||
else
|
else
|
||||||
{ // instance type expected by the user-provided hook
|
{ // instance type expected by the user-provided hook
|
||||||
using Target = typename _Fun<HOOK>::Args::List::Head;
|
using Target = _Fun<HOOK>::Args::List::Head;
|
||||||
return [hook = forward<HOOK>(hook)]
|
return [hook = forward<HOOK>(hook)]
|
||||||
(Arg& threadWrapper)
|
(Arg& threadWrapper)
|
||||||
{ // build a two-step cast path from the low-level wrapper to user type
|
{ // build a two-step cast path from the low-level wrapper to user type
|
||||||
|
|
@ -764,7 +764,7 @@ namespace lib {
|
||||||
inline void
|
inline void
|
||||||
launchDetached (string const& threadID, INVO&& ...args)
|
launchDetached (string const& threadID, INVO&& ...args)
|
||||||
{
|
{
|
||||||
using Launch = typename TAR::Launch;
|
using Launch = TAR::Launch;
|
||||||
launchDetached<TAR> (Launch{forward<INVO> (args)...}
|
launchDetached<TAR> (Launch{forward<INVO> (args)...}
|
||||||
.threadID (threadID));
|
.threadID (threadID));
|
||||||
}
|
}
|
||||||
|
|
@ -774,7 +774,7 @@ namespace lib {
|
||||||
inline void
|
inline void
|
||||||
launchDetached (string const& threadID, void (TAR::*memFun) (ARGS...), ARGS ...args)
|
launchDetached (string const& threadID, void (TAR::*memFun) (ARGS...), ARGS ...args)
|
||||||
{
|
{
|
||||||
using Launch = typename TAR::Launch;
|
using Launch = TAR::Launch;
|
||||||
launchDetached<TAR> (Launch{std::move (memFun)
|
launchDetached<TAR> (Launch{std::move (memFun)
|
||||||
,lib::meta::InstancePlaceholder<TAR>{}
|
,lib::meta::InstancePlaceholder<TAR>{}
|
||||||
,forward<ARGS> (args)...
|
,forward<ARGS> (args)...
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ namespace mutation {
|
||||||
TI
|
TI
|
||||||
operator() (TI const& changedVal) const
|
operator() (TI const& changedVal) const
|
||||||
{
|
{
|
||||||
typedef typename ListenerList::const_iterator Iter;
|
using Iter = ListenerList::const_iterator;
|
||||||
Iter p = listeners_.begin();
|
Iter p = listeners_.begin();
|
||||||
Iter e = listeners_.end();
|
Iter e = listeners_.end();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ namespace time {
|
||||||
static Supported
|
static Supported
|
||||||
formats()
|
formats()
|
||||||
{
|
{
|
||||||
typedef typename TY::List SupportedFormats;
|
using SupportedFormats = TY::List;
|
||||||
return Supported().define(SupportedFormats());
|
return Supported().define(SupportedFormats());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ namespace time {
|
||||||
bool supports() const; ///< does our implicit time grid support building that timecode format?
|
bool supports() const; ///< does our implicit time grid support building that timecode format?
|
||||||
|
|
||||||
template<class FMT>
|
template<class FMT>
|
||||||
typename format::Traits<FMT>::TimeCode
|
format::Traits<FMT>::TimeCode
|
||||||
formatAs() const; ///< create new time code instance, then #castInto
|
formatAs() const; ///< create new time code instance, then #castInto
|
||||||
|
|
||||||
template<class TC>
|
template<class TC>
|
||||||
|
|
@ -133,10 +133,10 @@ namespace time {
|
||||||
|
|
||||||
|
|
||||||
template<class FMT>
|
template<class FMT>
|
||||||
inline typename format::Traits<FMT>::TimeCode
|
inline format::Traits<FMT>::TimeCode
|
||||||
QuTime::formatAs() const
|
QuTime::formatAs() const
|
||||||
{
|
{
|
||||||
using TC = typename format::Traits<FMT>::TimeCode;
|
using TC = format::Traits<FMT>::TimeCode;
|
||||||
return TC(*this);
|
return TC(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ namespace time {
|
||||||
inline void
|
inline void
|
||||||
QuTime::castInto (TC& timecode) const
|
QuTime::castInto (TC& timecode) const
|
||||||
{
|
{
|
||||||
using Format = typename TC::Format;
|
using Format = TC::Format;
|
||||||
REQUIRE (supports<Format>());
|
REQUIRE (supports<Format>());
|
||||||
|
|
||||||
Format::rebuild (timecode, *quantiser_, TimeValue(*this));
|
Format::rebuild (timecode, *quantiser_, TimeValue(*this));
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace util {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct treat_as_STL_Container
|
struct treat_as_STL_Container
|
||||||
{
|
{
|
||||||
typedef typename lib::meta::Unwrap<T>::Type TaT;
|
typedef lib::meta::Unwrap<T>::Type TaT;
|
||||||
|
|
||||||
enum{ value = lib::meta::can_STL_ForEach<TaT>::value
|
enum{ value = lib::meta::can_STL_ForEach<TaT>::value
|
||||||
&&!lib::meta::can_IterForEach<T>::value
|
&&!lib::meta::can_IterForEach<T>::value
|
||||||
|
|
@ -71,7 +71,7 @@ namespace util {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct can_direct_access_Last
|
struct can_direct_access_Last
|
||||||
{
|
{
|
||||||
typedef typename lib::meta::Unwrap<T>::Type TaT;
|
typedef lib::meta::Unwrap<T>::Type TaT;
|
||||||
|
|
||||||
enum{ value = lib::meta::can_STL_backIteration<TaT>::value
|
enum{ value = lib::meta::can_STL_backIteration<TaT>::value
|
||||||
};
|
};
|
||||||
|
|
@ -159,7 +159,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
max (IT&& elms)
|
max (IT&& elms)
|
||||||
{
|
{
|
||||||
using Val = typename std::remove_reference_t<IT>::value_type;
|
using Val = std::remove_reference_t<IT>::value_type;
|
||||||
Val res = std::numeric_limits<Val>::min();
|
Val res = std::numeric_limits<Val>::min();
|
||||||
for (auto const& elm : std::forward<IT> (elms))
|
for (auto const& elm : std::forward<IT> (elms))
|
||||||
if (elm > res)
|
if (elm > res)
|
||||||
|
|
@ -171,7 +171,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
max (CON const& elms)
|
max (CON const& elms)
|
||||||
{
|
{
|
||||||
using Val = typename std::remove_reference_t<CON>::value_type;
|
using Val = std::remove_reference_t<CON>::value_type;
|
||||||
Val res = std::numeric_limits<Val>::min();
|
Val res = std::numeric_limits<Val>::min();
|
||||||
for (auto const& elm : elms)
|
for (auto const& elm : elms)
|
||||||
if (elm > res)
|
if (elm > res)
|
||||||
|
|
@ -184,7 +184,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
min (IT&& elms)
|
min (IT&& elms)
|
||||||
{
|
{
|
||||||
using Val = typename std::remove_reference_t<IT>::value_type;
|
using Val = std::remove_reference_t<IT>::value_type;
|
||||||
Val res = std::numeric_limits<Val>::max();
|
Val res = std::numeric_limits<Val>::max();
|
||||||
for (auto const& elm : std::forward<IT> (elms))
|
for (auto const& elm : std::forward<IT> (elms))
|
||||||
if (elm < res)
|
if (elm < res)
|
||||||
|
|
@ -196,7 +196,7 @@ namespace util {
|
||||||
inline auto
|
inline auto
|
||||||
min (CON const& elms)
|
min (CON const& elms)
|
||||||
{
|
{
|
||||||
using Val = typename std::remove_reference_t<CON>::value_type;
|
using Val = std::remove_reference_t<CON>::value_type;
|
||||||
Val res = std::numeric_limits<Val>::max();
|
Val res = std::numeric_limits<Val>::max();
|
||||||
for (auto const& elm : elms)
|
for (auto const& elm : elms)
|
||||||
if (elm < res)
|
if (elm < res)
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ namespace util {
|
||||||
|
|
||||||
/** fetch value from a Map, or return a default if not found */
|
/** fetch value from a Map, or return a default if not found */
|
||||||
template <typename MAP>
|
template <typename MAP>
|
||||||
inline typename MAP::mapped_type
|
inline MAP::mapped_type
|
||||||
getValue_or_default (MAP& map, typename MAP::key_type const& key
|
getValue_or_default (MAP& map, typename MAP::key_type const& key
|
||||||
, typename MAP::mapped_type defaultVal)
|
, typename MAP::mapped_type defaultVal)
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +288,7 @@ namespace util {
|
||||||
* @see lib::NullValue
|
* @see lib::NullValue
|
||||||
*/
|
*/
|
||||||
template <typename MAP>
|
template <typename MAP>
|
||||||
inline typename MAP::mapped_type const &
|
inline MAP::mapped_type const &
|
||||||
access_or_default (MAP& map, typename MAP::key_type const& key
|
access_or_default (MAP& map, typename MAP::key_type const& key
|
||||||
, typename MAP::mapped_type const& refDefault)
|
, typename MAP::mapped_type const& refDefault)
|
||||||
{
|
{
|
||||||
|
|
@ -302,7 +302,7 @@ namespace util {
|
||||||
/** shortcut for removing all copies of an Element
|
/** shortcut for removing all copies of an Element
|
||||||
* in any sequential collection */
|
* in any sequential collection */
|
||||||
template <typename SEQ>
|
template <typename SEQ>
|
||||||
inline typename SEQ::iterator
|
inline SEQ::iterator
|
||||||
removeall (SEQ& coll, typename SEQ::value_type const& val)
|
removeall (SEQ& coll, typename SEQ::value_type const& val)
|
||||||
{
|
{
|
||||||
typename SEQ::iterator collEnd = coll.end();
|
typename SEQ::iterator collEnd = coll.end();
|
||||||
|
|
@ -318,7 +318,7 @@ namespace util {
|
||||||
template<class SET, typename FUN>
|
template<class SET, typename FUN>
|
||||||
bool remove_if (SET& set, FUN test)
|
bool remove_if (SET& set, FUN test)
|
||||||
{
|
{
|
||||||
typedef typename SET::iterator Itor;
|
using Itor = SET::iterator;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
Itor end = set.end();
|
Itor end = set.end();
|
||||||
Itor begin = set.begin();
|
Itor begin = set.begin();
|
||||||
|
|
|
||||||
|
|
@ -221,9 +221,9 @@ namespace lib {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename RET>
|
template<typename RET>
|
||||||
using VisitorFunc = typename variant::VFunc<RET>::template VisitorInterface<TYPES>;
|
using VisitorFunc = variant::VFunc<RET>::template VisitorInterface<TYPES>;
|
||||||
template<typename RET>
|
template<typename RET>
|
||||||
using VisitorConstFunc = typename variant::VFunc<RET>::template VisitorInterface<meta::ConstAll<typename TYPES::List>>;
|
using VisitorConstFunc = variant::VFunc<RET>::template VisitorInterface<meta::ConstAll<typename TYPES::List>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* to be implemented by the client for visitation
|
* to be implemented by the client for visitation
|
||||||
|
|
@ -443,7 +443,7 @@ namespace lib {
|
||||||
|
|
||||||
Variant()
|
Variant()
|
||||||
{
|
{
|
||||||
using DefaultType = typename TYPES::List::Head;
|
using DefaultType = TYPES::List::Head;
|
||||||
|
|
||||||
new(storage_) Buff<DefaultType> (DefaultType());
|
new(storage_) Buff<DefaultType> (DefaultType());
|
||||||
}
|
}
|
||||||
|
|
@ -453,7 +453,7 @@ namespace lib {
|
||||||
{
|
{
|
||||||
static_assert (variant::CanBuildFrom<X, TYPES>(), "No type in Typelist can be built from the given argument");
|
static_assert (variant::CanBuildFrom<X, TYPES>(), "No type in Typelist can be built from the given argument");
|
||||||
|
|
||||||
using StorageType = typename variant::CanBuildFrom<X, TYPES>::Type;
|
using StorageType = variant::CanBuildFrom<X, TYPES>::Type;
|
||||||
|
|
||||||
new(storage_) Buff<StorageType> (forward<X>(x));
|
new(storage_) Buff<StorageType> (forward<X>(x));
|
||||||
}
|
}
|
||||||
|
|
@ -477,7 +477,7 @@ namespace lib {
|
||||||
Variant&
|
Variant&
|
||||||
operator= (X x)
|
operator= (X x)
|
||||||
{
|
{
|
||||||
using RawType = typename std::remove_reference<X>::type;
|
using RawType = std::remove_reference<X>::type;
|
||||||
static_assert (meta::isInList<RawType, typename TYPES::List>(),
|
static_assert (meta::isInList<RawType, typename TYPES::List>(),
|
||||||
"Type error: the given variant could never hold the required type");
|
"Type error: the given variant could never hold the required type");
|
||||||
static_assert (std::is_copy_assignable<RawType>::value, "target type does not support assignment");
|
static_assert (std::is_copy_assignable<RawType>::value, "target type does not support assignment");
|
||||||
|
|
|
||||||
|
|
@ -133,13 +133,13 @@ namespace lib {
|
||||||
using Args = std::tuple<ARGS...>;
|
using Args = std::tuple<ARGS...>;
|
||||||
|
|
||||||
/** meta-sequence to pick argument values from the storage tuple */
|
/** meta-sequence to pick argument values from the storage tuple */
|
||||||
using SequenceIterator = typename meta::BuildIdxIter<ARGS...>::Ascending;
|
using SequenceIterator = meta::BuildIdxIter<ARGS...>::Ascending;
|
||||||
|
|
||||||
/** Storage for the argument tuple */
|
/** Storage for the argument tuple */
|
||||||
Args args_;
|
Args args_;
|
||||||
|
|
||||||
template<typename...PARS>
|
template<typename...PARS>
|
||||||
VerbHolder (typename Verb::Handler handlerRef, Literal verbID, PARS&&... args)
|
VerbHolder (Verb::Handler handlerRef, Literal verbID, PARS&&... args)
|
||||||
: Verb{handlerRef, verbID}
|
: Verb{handlerRef, verbID}
|
||||||
, args_{std::forward<PARS> (args)...}
|
, args_{std::forward<PARS> (args)...}
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -203,7 +203,7 @@ namespace lib {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename FUN>
|
template<typename FUN>
|
||||||
using PayloadType = typename HandlerTypeDetector<FUN>::Payload *;
|
using PayloadType = HandlerTypeDetector<FUN>::Payload *;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ namespace visitor {
|
||||||
template<class TAR, class TOOL>
|
template<class TAR, class TOOL>
|
||||||
class Dispatcher
|
class Dispatcher
|
||||||
{
|
{
|
||||||
using ReturnType = typename TOOL::ReturnType;
|
using ReturnType = TOOL::ReturnType;
|
||||||
|
|
||||||
/** generator for Trampoline functions,
|
/** generator for Trampoline functions,
|
||||||
* used to dispatch calls down to the
|
* used to dispatch calls down to the
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ namespace visitor {
|
||||||
: public Applicable<TOOLImpl, TYPES, BASE>
|
: public Applicable<TOOLImpl, TYPES, BASE>
|
||||||
{
|
{
|
||||||
|
|
||||||
using ToolBase = typename BASE::ToolBase;
|
using ToolBase = BASE::ToolBase;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~Applicable () {}
|
virtual ~Applicable () {}
|
||||||
|
|
@ -188,7 +188,7 @@ namespace visitor {
|
||||||
class Visitable
|
class Visitable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ReturnType = typename TOOL::ReturnType;
|
using ReturnType = TOOL::ReturnType;
|
||||||
|
|
||||||
/** to be defined by the DEFINE_PROCESSABLE_BY macro
|
/** to be defined by the DEFINE_PROCESSABLE_BY macro
|
||||||
* in all classes wanting to be treated by some tool */
|
* in all classes wanting to be treated by some tool */
|
||||||
|
|
@ -199,7 +199,7 @@ namespace visitor {
|
||||||
virtual ~Visitable () { };
|
virtual ~Visitable () { };
|
||||||
|
|
||||||
/// @note may differ from TOOL
|
/// @note may differ from TOOL
|
||||||
using ToolBase = typename TOOL::ToolBase;
|
using ToolBase = TOOL::ToolBase;
|
||||||
|
|
||||||
/** @internal used by the #DEFINE_PROCESSABLE_BY macro.
|
/** @internal used by the #DEFINE_PROCESSABLE_BY macro.
|
||||||
* Dispatches to the actual operation on the
|
* Dispatches to the actual operation on the
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace wrapper {
|
||||||
: public function<SIG>
|
: public function<SIG>
|
||||||
, util::NonCopyable
|
, util::NonCopyable
|
||||||
{
|
{
|
||||||
using Res = typename _Fun<SIG>::Ret;
|
using Res = _Fun<SIG>::Ret;
|
||||||
using ResWrapper = ItemWrapper<Res>;
|
using ResWrapper = ItemWrapper<Res>;
|
||||||
|
|
||||||
ResWrapper lastResult_;
|
ResWrapper lastResult_;
|
||||||
|
|
|
||||||
|
|
@ -210,10 +210,10 @@ namespace interact {
|
||||||
using lib::meta::Types;
|
using lib::meta::Types;
|
||||||
using lib::meta::func::PApply;
|
using lib::meta::func::PApply;
|
||||||
|
|
||||||
using Ret = typename _Fun<FUN>::Ret;
|
using Ret = _Fun<FUN>::Ret;
|
||||||
using Args = typename _Fun<FUN>::Args;
|
using Args = _Fun<FUN>::Args;
|
||||||
using Arg1 = typename Split<Args>::Head;
|
using Arg1 = Split<Args>::Head;
|
||||||
using FurtherArgs = typename Split<Args>::Tail;
|
using FurtherArgs = Split<Args>::Tail;
|
||||||
|
|
||||||
static_assert (std::is_convertible<UICoord, Arg1>::value,
|
static_assert (std::is_convertible<UICoord, Arg1>::value,
|
||||||
"Allocator function must accept UICoordinates (where to create/locate) as first argument");
|
"Allocator function must accept UICoordinates (where to create/locate) as first argument");
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace model {
|
||||||
template<typename X> // note the "backward" use. We pick that base interface
|
template<typename X> // note the "backward" use. We pick that base interface
|
||||||
using canUpcast = std::is_convertible<TAR*, X>; // into which our desired result type can be upcast, because
|
using canUpcast = std::is_convertible<TAR*, X>; // into which our desired result type can be upcast, because
|
||||||
// we know the then following dynamic_cast (downcast) can succeed
|
// we know the then following dynamic_cast (downcast) can succeed
|
||||||
using Base = typename RawResult::FirstMatching<canUpcast>::Type;
|
using Base = RawResult::FirstMatching<canUpcast>::Type;
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
handle (Base& pb) override
|
handle (Base& pb) override
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,8 @@ namespace control {
|
||||||
template<typename SIG>
|
template<typename SIG>
|
||||||
struct _Type
|
struct _Type
|
||||||
{
|
{
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using Ret = typename _Fun<SIG>::Ret;
|
using Ret = _Fun<SIG>::Ret;
|
||||||
using Sig = SIG;
|
using Sig = SIG;
|
||||||
using ArgTuple = Tuple<Args>;
|
using ArgTuple = Tuple<Args>;
|
||||||
};
|
};
|
||||||
|
|
@ -150,9 +150,9 @@ namespace control {
|
||||||
template<typename...TYPES>
|
template<typename...TYPES>
|
||||||
struct _Type<std::tuple<TYPES...> >
|
struct _Type<std::tuple<TYPES...> >
|
||||||
{
|
{
|
||||||
using Args = typename Types<TYPES...>::Seq;
|
using Args = Types<TYPES...>::Seq;
|
||||||
using Ret = void;
|
using Ret = void;
|
||||||
using Sig = typename BuildFunType<void, Args>::Sig;
|
using Sig = BuildFunType<void, Args>::Sig;
|
||||||
using ArgTuple = std::tuple<TYPES...>;
|
using ArgTuple = std::tuple<TYPES...>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ namespace control {
|
||||||
{
|
{
|
||||||
Command& prototype_;
|
Command& prototype_;
|
||||||
|
|
||||||
using CmdArgs = typename _Fun<SIG>::Args;
|
using CmdArgs = _Fun<SIG>::Args;
|
||||||
|
|
||||||
CompletedDefinition (Command& definedCommand)
|
CompletedDefinition (Command& definedCommand)
|
||||||
: prototype_(definedCommand)
|
: prototype_(definedCommand)
|
||||||
|
|
@ -109,7 +109,7 @@ namespace control {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef HandlingPattern::ID PattID;
|
using PattID = HandlingPattern::ID;
|
||||||
|
|
||||||
/** allow for defining the default execution pattern,
|
/** allow for defining the default execution pattern,
|
||||||
* which is used by Command::operator() */
|
* which is used by Command::operator() */
|
||||||
|
|
@ -159,15 +159,15 @@ namespace control {
|
||||||
template<typename SIG, typename MEM>
|
template<typename SIG, typename MEM>
|
||||||
struct UndoDefinition
|
struct UndoDefinition
|
||||||
{
|
{
|
||||||
typedef CommandSignature<SIG,MEM> CmdType;
|
using CmdType = CommandSignature<SIG,MEM>;
|
||||||
typedef typename CmdType::OperateSig CommandOperationSig;
|
using CommandOperationSig = CmdType::OperateSig;
|
||||||
typedef typename CmdType::UndoOp_Sig UndoOperationSig;
|
using UndoOperationSig = CmdType::UndoOp_Sig;
|
||||||
typedef typename CmdType::CaptureSig UndoCaptureSig;
|
using UndoCaptureSig = CmdType::CaptureSig;
|
||||||
typedef typename CmdType::CmdArgs CmdArgs;
|
using CmdArgs = CmdType::CmdArgs;
|
||||||
|
|
||||||
typedef function<CommandOperationSig> OperFunc;
|
using OperFunc = function<CommandOperationSig>;
|
||||||
typedef function<UndoOperationSig> UndoFunc;
|
using UndoFunc = function<UndoOperationSig>;
|
||||||
typedef function<UndoCaptureSig> CaptFunc;
|
using CaptFunc = function<UndoCaptureSig>;
|
||||||
|
|
||||||
Activation activatePrototype_;
|
Activation activatePrototype_;
|
||||||
OperFunc operFunctor_;
|
OperFunc operFunctor_;
|
||||||
|
|
@ -233,9 +233,9 @@ namespace control {
|
||||||
auto
|
auto
|
||||||
captureUndo (FUN2 how_to_capture_UndoState)
|
captureUndo (FUN2 how_to_capture_UndoState)
|
||||||
{
|
{
|
||||||
using Sig2 = typename _Fun<FUN2>::Sig;
|
using Sig2 = _Fun<FUN2>::Sig;
|
||||||
using UndoCapSig = typename UndoSignature<Sig2>::CaptureSig;
|
using UndoCapSig = UndoSignature<Sig2>::CaptureSig;
|
||||||
using SpecificUndoDefinition = typename BuildUndoDefType<UndoSignature<Sig2>>::Type;
|
using SpecificUndoDefinition = BuildUndoDefType<UndoSignature<Sig2>>::Type;
|
||||||
|
|
||||||
function<UndoCapSig> captureOperation (how_to_capture_UndoState);
|
function<UndoCapSig> captureOperation (how_to_capture_UndoState);
|
||||||
return SpecificUndoDefinition (callback_, operation_, captureOperation);
|
return SpecificUndoDefinition (callback_, operation_, captureOperation);
|
||||||
|
|
@ -287,7 +287,7 @@ namespace control {
|
||||||
auto
|
auto
|
||||||
operation (FUN operation_to_define)
|
operation (FUN operation_to_define)
|
||||||
{
|
{
|
||||||
using Sig = typename _Fun<FUN>::Sig;
|
using Sig = _Fun<FUN>::Sig;
|
||||||
|
|
||||||
function<Sig> opera1 (operation_to_define);
|
function<Sig> opera1 (operation_to_define);
|
||||||
Activation callback_when_defined = bind (&CommandDef::activate, this, _1);
|
Activation callback_when_defined = bind (&CommandDef::activate, this, _1);
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,13 @@ namespace control {
|
||||||
template<typename ARG>
|
template<typename ARG>
|
||||||
struct _Type
|
struct _Type
|
||||||
{
|
{
|
||||||
typedef typename ARG::SIG_op SIG_op;
|
using SIG_op = ARG::SIG_op;
|
||||||
typedef typename ARG::SIG_cap SIG_cap;
|
using SIG_cap = ARG::SIG_cap;
|
||||||
typedef typename ARG::SIG_undo SIG_undo;
|
using SIG_undo = ARG::SIG_undo;
|
||||||
|
|
||||||
typedef function<SIG_op> Func_op;
|
using Func_op = function<SIG_op>;
|
||||||
typedef function<SIG_cap> Func_cap;
|
using Func_cap = function<SIG_cap>;
|
||||||
typedef function<SIG_undo> Func_undo;
|
using Func_undo = function<SIG_undo>;
|
||||||
};
|
};
|
||||||
#define _TY(_ID_) typename _Type<ARG>::_ID_
|
#define _TY(_ID_) typename _Type<ARG>::_ID_
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ namespace control {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef HandlingPattern::ID PattID;
|
using PattID = HandlingPattern::ID;
|
||||||
|
|
||||||
PattID
|
PattID
|
||||||
getDefaultHandlingPattern() const
|
getDefaultHandlingPattern() const
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,10 @@ namespace control {
|
||||||
template<typename SIG>
|
template<typename SIG>
|
||||||
class OpClosure
|
class OpClosure
|
||||||
{
|
{
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using Builder = BuildTupleAccessor<ParamAccessor, Args>;
|
using Builder = BuildTupleAccessor<ParamAccessor, Args>;
|
||||||
|
|
||||||
using ParamStorageTuple = typename Builder::Product;
|
using ParamStorageTuple = Builder::Product;
|
||||||
|
|
||||||
ParamStorageTuple params_;
|
ParamStorageTuple params_;
|
||||||
bool activated_;
|
bool activated_;
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,8 @@ namespace control {
|
||||||
, util::NonCopyable
|
, util::NonCopyable
|
||||||
{
|
{
|
||||||
// using a hashtable to implement the index
|
// using a hashtable to implement the index
|
||||||
typedef unordered_map<Symbol, Command, hash<Symbol>> CmdIndex;
|
using CmdIndex = unordered_map<Symbol, Command, hash<Symbol>>;
|
||||||
typedef map< const Command*, Symbol, order_by_impl> ReverseIndex;
|
using ReverseIndex = map< const Command*, Symbol, order_by_impl>;
|
||||||
|
|
||||||
TypedAllocationManager allocator_;
|
TypedAllocationManager allocator_;
|
||||||
CmdIndex index_;
|
CmdIndex index_;
|
||||||
|
|
@ -236,8 +236,8 @@ namespace control {
|
||||||
|
|
||||||
// derive the storage type necessary
|
// derive the storage type necessary
|
||||||
// to hold the command arguments and UNDO memento
|
// to hold the command arguments and UNDO memento
|
||||||
typedef typename UndoSignature<SIG_CAPT>::Memento Mem;
|
using Mem = UndoSignature<SIG_CAPT>::Memento;
|
||||||
typedef StorageHolder<SIG_OPER,Mem> Arguments;
|
using Arguments = StorageHolder<SIG_OPER,Mem>;
|
||||||
|
|
||||||
shared_ptr<Arguments> pArg (allocator_.create<Arguments>());
|
shared_ptr<Arguments> pArg (allocator_.create<Arguments>());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,15 +74,15 @@ namespace control {
|
||||||
template<typename SIG, typename MEM>
|
template<typename SIG, typename MEM>
|
||||||
class CommandSignature
|
class CommandSignature
|
||||||
{
|
{
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using ArgList = typename Args::List;
|
using ArgList = Args::List;
|
||||||
using ExtendedArglist = typename Append<ArgList, MEM>::List;
|
using ExtendedArglist = Append<ArgList, MEM>::List;
|
||||||
using ExtendedArgs = typename Types<ExtendedArglist>::Seq;
|
using ExtendedArgs = Types<ExtendedArglist>::Seq;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using OperateSig = typename BuildFunType<void, Args>::Sig;
|
using OperateSig = BuildFunType<void, Args>::Sig;
|
||||||
using CaptureSig = typename BuildFunType<MEM, Args>::Sig;
|
using CaptureSig = BuildFunType<MEM, Args>::Sig;
|
||||||
using UndoOp_Sig = typename BuildFunType<void, ExtendedArgs>::Sig;
|
using UndoOp_Sig = BuildFunType<void, ExtendedArgs>::Sig;
|
||||||
using CmdArgs = Args;
|
using CmdArgs = Args;
|
||||||
using Memento = MEM;
|
using Memento = MEM;
|
||||||
};
|
};
|
||||||
|
|
@ -108,8 +108,8 @@ namespace control {
|
||||||
class UndoSignature
|
class UndoSignature
|
||||||
{
|
{
|
||||||
// preparation: dissect the function signature into arguments and result
|
// preparation: dissect the function signature into arguments and result
|
||||||
using Args = typename _Fun<SIG>::Args;
|
using Args = _Fun<SIG>::Args;
|
||||||
using Ret = typename _Fun<SIG>::Ret;
|
using Ret = _Fun<SIG>::Ret;
|
||||||
|
|
||||||
/** Case1: defining the Undo-Capture function */
|
/** Case1: defining the Undo-Capture function */
|
||||||
template<typename RET, typename ARG>
|
template<typename RET, typename ARG>
|
||||||
|
|
@ -117,33 +117,33 @@ namespace control {
|
||||||
{
|
{
|
||||||
using Memento = RET;
|
using Memento = RET;
|
||||||
|
|
||||||
using ExtendedArglist = typename Append<ARG, Memento>::List;
|
using ExtendedArglist = Append<ARG, Memento>::List;
|
||||||
using ExtendedArgs = typename Types<ExtendedArglist>::Seq;
|
using ExtendedArgs = Types<ExtendedArglist>::Seq;
|
||||||
|
|
||||||
using OperateSig = typename BuildFunType<void, ARG>::Sig;
|
using OperateSig = BuildFunType<void, ARG>::Sig;
|
||||||
using CaptureSig = typename BuildFunType<Ret,ARG>::Sig;
|
using CaptureSig = BuildFunType<Ret,ARG>::Sig;
|
||||||
using UndoOp_Sig = typename BuildFunType<void, ExtendedArgs>::Sig;
|
using UndoOp_Sig = BuildFunType<void, ExtendedArgs>::Sig;
|
||||||
};
|
};
|
||||||
/** Case2: defining the actual Undo function */
|
/** Case2: defining the actual Undo function */
|
||||||
template<typename ARG>
|
template<typename ARG>
|
||||||
struct Case<void,ARG>
|
struct Case<void,ARG>
|
||||||
{
|
{
|
||||||
using Args = typename ARG::List;
|
using Args = ARG::List;
|
||||||
|
|
||||||
using Memento = typename PickLast<Args>::Type;
|
using Memento = PickLast<Args>::Type;
|
||||||
using OperationArglist = typename PickLast<Args>::List;
|
using OperationArglist = PickLast<Args>::List;
|
||||||
using OperationArgs = typename Types<OperationArglist>::Seq;
|
using OperationArgs = Types<OperationArglist>::Seq;
|
||||||
|
|
||||||
using OperateSig = typename BuildFunType<void, OperationArgs>::Sig;
|
using OperateSig = BuildFunType<void, OperationArgs>::Sig;
|
||||||
using CaptureSig = typename BuildFunType<Ret,OperationArgs>::Sig;
|
using CaptureSig = BuildFunType<Ret,OperationArgs>::Sig;
|
||||||
using UndoOp_Sig = typename BuildFunType<void, ARG>::Sig;
|
using UndoOp_Sig = BuildFunType<void, ARG>::Sig;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using CaptureSig = typename Case<Ret,Args>::CaptureSig;
|
using CaptureSig = Case<Ret,Args>::CaptureSig;
|
||||||
using UndoOp_Sig = typename Case<Ret,Args>::UndoOp_Sig;
|
using UndoOp_Sig = Case<Ret,Args>::UndoOp_Sig;
|
||||||
using OperateSig = typename Case<Ret,Args>::OperateSig;
|
using OperateSig = Case<Ret,Args>::OperateSig;
|
||||||
using Memento = typename Case<Ret,Args>::Memento;
|
using Memento = Case<Ret,Args>::Memento;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ namespace control {
|
||||||
using ArgHolder = OpClosure<SIG>;
|
using ArgHolder = OpClosure<SIG>;
|
||||||
using ArgumentBuff = InPlaceBuffer<ArgHolder>;
|
using ArgumentBuff = InPlaceBuffer<ArgHolder>;
|
||||||
|
|
||||||
using ArgTuple = typename ArgHolder::ArgTuple;
|
using ArgTuple = ArgHolder::ArgTuple;
|
||||||
using Args = typename lib::meta::RebindTupleTypes<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
using Args = lib::meta::RebindTupleTypes<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
||||||
|
|
||||||
|
|
||||||
/* ====== in-place argument storage ====== */
|
/* ====== in-place argument storage ====== */
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ namespace control {
|
||||||
using ArgumentBuff = InPlaceBuffer<ArgHolder>;
|
using ArgumentBuff = InPlaceBuffer<ArgHolder>;
|
||||||
using MementoBuff = InPlaceBuffer<MemHolder>;
|
using MementoBuff = InPlaceBuffer<MemHolder>;
|
||||||
|
|
||||||
using ArgTuple = typename ArgHolder::ArgTuple;
|
using ArgTuple = ArgHolder::ArgTuple;
|
||||||
using Args = typename lib::meta::RebindTupleTypes<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
using Args = lib::meta::RebindTupleTypes<ArgTuple>::Seq; // std::tuple<ARGS...> to Types<ARGS...>
|
||||||
|
|
||||||
|
|
||||||
/* ====== in-place storage buffers ====== */
|
/* ====== in-place storage buffers ====== */
|
||||||
|
|
@ -215,9 +215,9 @@ namespace control {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef typename CommandSignature<SIG,MEM>::OperateSig SIG_op;
|
using SIG_op = CommandSignature<SIG,MEM>::OperateSig;
|
||||||
typedef typename CommandSignature<SIG,MEM>::CaptureSig SIG_cap;
|
using SIG_cap = CommandSignature<SIG,MEM>::CaptureSig;
|
||||||
typedef typename CommandSignature<SIG,MEM>::UndoOp_Sig SIG_undo;
|
using SIG_undo = CommandSignature<SIG,MEM>::UndoOp_Sig;
|
||||||
|
|
||||||
/** create a new memento storage wiring, discarding existing memento state.
|
/** create a new memento storage wiring, discarding existing memento state.
|
||||||
* @note any bound undo/capture functions based on the previously held MementoTie
|
* @note any bound undo/capture functions based on the previously held MementoTie
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace control {
|
||||||
class BasicHandlingPattern
|
class BasicHandlingPattern
|
||||||
: public HandlingPattern
|
: public HandlingPattern
|
||||||
{
|
{
|
||||||
bool isValid() const { return true; }
|
bool isValid() const override { return true; }
|
||||||
|
|
||||||
void
|
void
|
||||||
performExec (CommandImpl& command) const override
|
performExec (CommandImpl& command) const override
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@ namespace control {
|
||||||
template<typename SIG, typename MEM>
|
template<typename SIG, typename MEM>
|
||||||
class MementoTie
|
class MementoTie
|
||||||
{
|
{
|
||||||
typedef typename CommandSignature<SIG,MEM>::CaptureSig SIG_cap;
|
using SIG_cap = CommandSignature<SIG,MEM>::CaptureSig;
|
||||||
typedef typename CommandSignature<SIG,MEM>::UndoOp_Sig SIG_undo;
|
using SIG_undo = CommandSignature<SIG,MEM>::UndoOp_Sig;
|
||||||
|
|
||||||
ItemWrapper<MEM> memento_; ///< storage holding the captured state for undo
|
ItemWrapper<MEM> memento_; ///< storage holding the captured state for undo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,13 +157,13 @@ namespace engine {
|
||||||
static_assert(0 < _Fun<FUN>::ARITY , "function with at least one argument expected");
|
static_assert(0 < _Fun<FUN>::ARITY , "function with at least one argument expected");
|
||||||
static_assert(3 >= _Fun<FUN>::ARITY , "function with up to three arguments accepted");
|
static_assert(3 >= _Fun<FUN>::ARITY , "function with up to three arguments accepted");
|
||||||
|
|
||||||
using Sig = typename _Fun<FUN>::Sig;
|
using Sig = _Fun<FUN>::Sig;
|
||||||
|
|
||||||
template<size_t i>
|
template<size_t i>
|
||||||
using _Arg = typename lib::meta::Pick<typename _Fun<Sig>::Args, i>::Type;
|
using _Arg = lib::meta::Pick<typename _Fun<Sig>::Args, i>::Type;
|
||||||
|
|
||||||
template<size_t i, template<class> class COND>
|
template<size_t i, template<class> class COND>
|
||||||
using AllElements = typename ElmTypes<_Arg<i>>::template AndAll<COND>;
|
using AllElements = ElmTypes<_Arg<i>>::template AndAll<COND>;
|
||||||
|
|
||||||
template<size_t i>
|
template<size_t i>
|
||||||
static constexpr bool nonEmpty = ElmTypes<_Arg<i>>::SIZ;
|
static constexpr bool nonEmpty = ElmTypes<_Arg<i>>::SIZ;
|
||||||
|
|
@ -205,9 +205,9 @@ namespace engine {
|
||||||
using SigI = _Arg<_Case<Sig>::SLOT_I>;
|
using SigI = _Arg<_Case<Sig>::SLOT_I>;
|
||||||
using SigO = _Arg<_Case<Sig>::SLOT_O>;
|
using SigO = _Arg<_Case<Sig>::SLOT_O>;
|
||||||
using SigP = _Arg< 0>;
|
using SigP = _Arg< 0>;
|
||||||
using ArgI = typename ElmTypes<SigI>::Seq;
|
using ArgI = ElmTypes<SigI>::Seq;
|
||||||
using ArgO = typename ElmTypes<SigO>::Seq;
|
using ArgO = ElmTypes<SigO>::Seq;
|
||||||
using ArgP = typename ElmTypes<SigP>::Seq;
|
using ArgP = ElmTypes<SigP>::Seq;
|
||||||
|
|
||||||
// Metaprogramming helper for Buffer types (sans pointer)
|
// Metaprogramming helper for Buffer types (sans pointer)
|
||||||
using ElmsI = ElmTypes<typename ElmTypes<SigI>::template Apply<remove_pointer_t>>;
|
using ElmsI = ElmTypes<typename ElmTypes<SigI>::template Apply<remove_pointer_t>>;
|
||||||
|
|
@ -252,7 +252,7 @@ namespace engine {
|
||||||
using Param = conditional_t<hasParam(), typename _Proc::SigP, std::tuple<>>;
|
using Param = conditional_t<hasParam(), typename _Proc::SigP, std::tuple<>>;
|
||||||
|
|
||||||
template<class PF>
|
template<class PF>
|
||||||
using Res = typename _Fun<PF>::Ret;
|
using Res = _Fun<PF>::Ret;
|
||||||
template<class PF>
|
template<class PF>
|
||||||
using SigP = add_pointer_t<typename _Fun<PF>::Sig>;
|
using SigP = add_pointer_t<typename _Fun<PF>::Sig>;
|
||||||
|
|
||||||
|
|
@ -335,7 +335,7 @@ namespace engine {
|
||||||
|
|
||||||
using Param = conditional_t<hasParam(), typename _Trait::SigP, std::tuple<>>;
|
using Param = conditional_t<hasParam(), typename _Trait::SigP, std::tuple<>>;
|
||||||
using ArgI = conditional_t<hasInput(), typename _Trait::SigI, std::tuple<>>;
|
using ArgI = conditional_t<hasInput(), typename _Trait::SigI, std::tuple<>>;
|
||||||
using ArgO = typename _Trait::SigO;
|
using ArgO = _Trait::SigO;
|
||||||
|
|
||||||
|
|
||||||
/** FeedManifold building block: hold parameter data */
|
/** FeedManifold building block: hold parameter data */
|
||||||
|
|
@ -368,7 +368,7 @@ namespace engine {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
using enable_if_hasParam = typename lib::meta::enable_if_c<_ProcFun<F>::hasParam()>::type;
|
using enable_if_hasParam = lib::meta::enable_if_c<_ProcFun<F>::hasParam()>::type;
|
||||||
|
|
||||||
template<class X>
|
template<class X>
|
||||||
using NotProvided = Tagged<Nil, X>;
|
using NotProvided = Tagged<Nil, X>;
|
||||||
|
|
@ -445,14 +445,14 @@ namespace engine {
|
||||||
{
|
{
|
||||||
using _T = _ProcFun<FUN>;
|
using _T = _ProcFun<FUN>;
|
||||||
using _S = _StorageSetup<FUN>;
|
using _S = _StorageSetup<FUN>;
|
||||||
using _F = typename _S::Storage;
|
using _F = _S::Storage;
|
||||||
|
|
||||||
/** pass-through constructor */
|
/** pass-through constructor */
|
||||||
using _S::Storage::Storage;
|
using _S::Storage::Storage;
|
||||||
|
|
||||||
using ArgI = typename _S::ArgI;
|
using ArgI = _S::ArgI;
|
||||||
using ArgO = typename _S::ArgO;
|
using ArgO = _S::ArgO;
|
||||||
using Param = typename _S::Param;
|
using Param = _S::Param;
|
||||||
enum{ FAN_I = _S::FAN_I
|
enum{ FAN_I = _S::FAN_I
|
||||||
, FAN_O = _S::FAN_O
|
, FAN_O = _S::FAN_O
|
||||||
, FAN_P = _S::FAN_P
|
, FAN_P = _S::FAN_P
|
||||||
|
|
@ -480,8 +480,8 @@ namespace engine {
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
using TupI = typename _T::ElmsI::Tup;
|
using TupI = _T::ElmsI::Tup;
|
||||||
using TupO = typename _T::ElmsO::Tup;
|
using TupO = _T::ElmsO::Tup;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -560,13 +560,13 @@ namespace engine {
|
||||||
, FAN_O = Feed::FAN_O
|
, FAN_O = Feed::FAN_O
|
||||||
, FAN_P = Feed::FAN_P
|
, FAN_P = Feed::FAN_P
|
||||||
};
|
};
|
||||||
using ElmsI = typename _Proc::ElmsI;
|
using ElmsI = _Proc::ElmsI;
|
||||||
using ElmsO = typename _Proc::ElmsO;
|
using ElmsO = _Proc::ElmsO;
|
||||||
using ElmsP = conditional_t<_Trait::hasParam(), typename _Proc::ArgP, Types<>>;
|
using ElmsP = conditional_t<_Trait::hasParam(), typename _Proc::ArgP, Types<>>;
|
||||||
using Param = typename _Proc::SigP; ///////////////////////////////////////////////////////////////////OOO qualify?
|
using Param = _Proc::SigP;
|
||||||
|
|
||||||
template<template<class> class META>
|
template<template<class> class META>
|
||||||
using OutTypesApply = typename ElmsO::template Apply<META>;
|
using OutTypesApply = ElmsO::template Apply<META>;
|
||||||
|
|
||||||
|
|
||||||
/** setup with processing-functor only */
|
/** setup with processing-functor only */
|
||||||
|
|
@ -680,8 +680,8 @@ namespace engine {
|
||||||
static_assert (isSuitableParamAdaptor<TRA>(), "Given functor's output not suitable "
|
static_assert (isSuitableParamAdaptor<TRA>(), "Given functor's output not suitable "
|
||||||
"for adapting the proc-functor's 1st argument");
|
"for adapting the proc-functor's 1st argument");
|
||||||
using SigP = lib::meta::_FunArg<TRA>;
|
using SigP = lib::meta::_FunArg<TRA>;
|
||||||
using SigI = typename _Proc::SigI;
|
using SigI = _Proc::SigI;
|
||||||
using SigO = typename _Proc::SigO;
|
using SigO = _Proc::SigO;
|
||||||
if constexpr (_Proc::hasInput())
|
if constexpr (_Proc::hasInput())
|
||||||
{
|
{
|
||||||
return [procFun = move(procFun_)
|
return [procFun = move(procFun_)
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ namespace engine {
|
||||||
struct MediaWeavingPattern
|
struct MediaWeavingPattern
|
||||||
: util::NonCopyable
|
: util::NonCopyable
|
||||||
{
|
{
|
||||||
using Feed = typename INVO::Feed;
|
using Feed = INVO::Feed;
|
||||||
|
|
||||||
static_assert (_verify_usable_as_InvocationAdapter<Feed>());
|
static_assert (_verify_usable_as_InvocationAdapter<Feed>());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -432,7 +432,7 @@ namespace engine {
|
||||||
auto
|
auto
|
||||||
attachParamFun (PFX paramFunctor)
|
attachParamFun (PFX paramFunctor)
|
||||||
{
|
{
|
||||||
using AdaptedWeavingBuilder = typename WAB::template Adapted<PFX>;
|
using AdaptedWeavingBuilder = WAB::template Adapted<PFX>;
|
||||||
using AdaptedPortBuilder = PortBuilder<POL,DAT,AdaptedWeavingBuilder>;
|
using AdaptedPortBuilder = PortBuilder<POL,DAT,AdaptedWeavingBuilder>;
|
||||||
//
|
//
|
||||||
return AdaptedPortBuilder{move(*this)
|
return AdaptedPortBuilder{move(*this)
|
||||||
|
|
@ -490,7 +490,7 @@ namespace engine {
|
||||||
auto
|
auto
|
||||||
adaptParam (ADA&& paramAdaptor)
|
adaptParam (ADA&& paramAdaptor)
|
||||||
{
|
{
|
||||||
using DecoratedPrototype = typename WAB::template Decorated<ADA>;
|
using DecoratedPrototype = WAB::template Decorated<ADA>;
|
||||||
using AdaptedPortBuilder = PortBuilder<POL,DAT,DecoratedPrototype>;
|
using AdaptedPortBuilder = PortBuilder<POL,DAT,DecoratedPrototype>;
|
||||||
//
|
//
|
||||||
return AdaptedPortBuilder{move(*this)
|
return AdaptedPortBuilder{move(*this)
|
||||||
|
|
@ -598,7 +598,7 @@ namespace engine {
|
||||||
auto
|
auto
|
||||||
PortBuilderRoot<POL,DAT>::invoke (StrView portSpec, FUN fun)
|
PortBuilderRoot<POL,DAT>::invoke (StrView portSpec, FUN fun)
|
||||||
{
|
{
|
||||||
using Prototype = typename FeedManifold<FUN>::Prototype;
|
using Prototype = FeedManifold<FUN>::Prototype;
|
||||||
using WeavingBuilder_FUN = WeavingBuilder<POL, Prototype>;
|
using WeavingBuilder_FUN = WeavingBuilder<POL, Prototype>;
|
||||||
return PortBuilder<POL,DAT, WeavingBuilder_FUN>{move(*this), move(fun), portSpec};
|
return PortBuilder<POL,DAT, WeavingBuilder_FUN>{move(*this), move(fun), portSpec};
|
||||||
}
|
}
|
||||||
|
|
@ -621,7 +621,7 @@ namespace engine {
|
||||||
{
|
{
|
||||||
using _Par = PortBuilderRoot<POL,DAT>;
|
using _Par = PortBuilderRoot<POL,DAT>;
|
||||||
|
|
||||||
using BlockBuilder = typename SPEC::BlockBuilder;
|
using BlockBuilder = SPEC::BlockBuilder;
|
||||||
using PostProcessor = function<void(TurnoutSystem&)>;
|
using PostProcessor = function<void(TurnoutSystem&)>;
|
||||||
|
|
||||||
BlockBuilder blockBuilder_;
|
BlockBuilder blockBuilder_;
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ namespace engine {
|
||||||
{
|
{
|
||||||
using Functors = tuple<FUNZ...>;
|
using Functors = tuple<FUNZ...>;
|
||||||
|
|
||||||
using ResTypes = typename ElmTypes<Functors>::template Apply<lib::meta::_FunRet>;
|
using ResTypes = ElmTypes<Functors>::template Apply<lib::meta::_FunRet>;
|
||||||
using ParamTup = Tuple<ResTypes>;
|
using ParamTup = Tuple<ResTypes>;
|
||||||
|
|
||||||
Functors functors_;
|
Functors functors_;
|
||||||
|
|
@ -185,7 +185,7 @@ namespace engine {
|
||||||
* @remark HeteroData defines a nested struct `Chain`, and with the help of `RebindVariadic`,
|
* @remark HeteroData defines a nested struct `Chain`, and with the help of `RebindVariadic`,
|
||||||
* the type sequence from the ParamTup can be used to instantiate this chain constructor.
|
* the type sequence from the ParamTup can be used to instantiate this chain constructor.
|
||||||
*/
|
*/
|
||||||
using ChainCons = typename lib::meta::RebindVariadic<ANCH::template Chain, ParamTup>::Type;
|
using ChainCons = lib::meta::RebindVariadic<ANCH::template Chain, ParamTup>::Type;
|
||||||
|
|
||||||
|
|
||||||
/** a (static) getter functor able to work on the full extended HeteroData-Chain
|
/** a (static) getter functor able to work on the full extended HeteroData-Chain
|
||||||
|
|
@ -196,7 +196,7 @@ namespace engine {
|
||||||
static auto&
|
static auto&
|
||||||
getParamVal (TurnoutSystem& turnoutSys)
|
getParamVal (TurnoutSystem& turnoutSys)
|
||||||
{
|
{
|
||||||
using StorageAccessor = typename ChainCons::template Accessor<slot>;
|
using StorageAccessor = ChainCons::template Accessor<slot>;
|
||||||
return turnoutSys.retrieveData (StorageAccessor());
|
return turnoutSys.retrieveData (StorageAccessor());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -221,7 +221,7 @@ namespace engine {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** invoke all parameter-functors and _drop off_ the result into a »chain-block« (non-copyable) */
|
/** invoke all parameter-functors and _drop off_ the result into a »chain-block« (non-copyable) */
|
||||||
typename ChainCons::NewFrame
|
ChainCons::NewFrame
|
||||||
buildParamDataBlock (TurnoutSystem& turnoutSys)
|
buildParamDataBlock (TurnoutSystem& turnoutSys)
|
||||||
{
|
{
|
||||||
return std::apply ([&](auto&&... paramFun)
|
return std::apply ([&](auto&&... paramFun)
|
||||||
|
|
@ -284,9 +284,9 @@ namespace engine {
|
||||||
struct ParamWeavingPattern
|
struct ParamWeavingPattern
|
||||||
: util::MoveOnly
|
: util::MoveOnly
|
||||||
{
|
{
|
||||||
using Functors = typename SPEC::Functors;
|
using Functors = SPEC::Functors;
|
||||||
using DataBlock = typename SPEC::ChainCons::NewFrame;
|
using DataBlock = SPEC::ChainCons::NewFrame;
|
||||||
using BlockBuilder = typename SPEC::BlockBuilder;
|
using BlockBuilder = SPEC::BlockBuilder;
|
||||||
using PostProcessor = function<void(TurnoutSystem&)>;
|
using PostProcessor = function<void(TurnoutSystem&)>;
|
||||||
|
|
||||||
BlockBuilder blockBuilder_;
|
BlockBuilder blockBuilder_;
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ namespace engine {
|
||||||
constexpr bool
|
constexpr bool
|
||||||
_verify_usable_as_WeavingPattern()
|
_verify_usable_as_WeavingPattern()
|
||||||
{
|
{
|
||||||
using Feed = typename PAT::Feed;
|
using Feed = PAT::Feed;
|
||||||
ASSERT_MEMBER_FUNCTOR (&PAT::mount, Feed(TurnoutSystem&));
|
ASSERT_MEMBER_FUNCTOR (&PAT::mount, Feed(TurnoutSystem&));
|
||||||
ASSERT_MEMBER_FUNCTOR (&PAT::pull, void(Feed&, TurnoutSystem&));
|
ASSERT_MEMBER_FUNCTOR (&PAT::pull, void(Feed&, TurnoutSystem&));
|
||||||
ASSERT_MEMBER_FUNCTOR (&PAT::shed, void(Feed&, TurnoutSystem&, OptionalBuff));
|
ASSERT_MEMBER_FUNCTOR (&PAT::shed, void(Feed&, TurnoutSystem&, OptionalBuff));
|
||||||
|
|
@ -117,7 +117,7 @@ namespace engine {
|
||||||
{
|
{
|
||||||
static_assert (_verify_usable_as_WeavingPattern<PAT>());
|
static_assert (_verify_usable_as_WeavingPattern<PAT>());
|
||||||
|
|
||||||
using Feed = typename PAT::Feed;
|
using Feed = PAT::Feed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename...INIT>
|
template<typename...INIT>
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ namespace engine {
|
||||||
|
|
||||||
/** type builder for FeedPrototype adapted to another parameter-fun */
|
/** type builder for FeedPrototype adapted to another parameter-fun */
|
||||||
template<class PFX>
|
template<class PFX>
|
||||||
using AdaptedPrototype = typename PROT::template Adapted<PFX>;
|
using AdaptedPrototype = PROT::template Adapted<PFX>;
|
||||||
template<class PFX>
|
template<class PFX>
|
||||||
using Adapted = WeavingBuilder<POL, AdaptedPrototype<PFX>>;
|
using Adapted = WeavingBuilder<POL, AdaptedPrototype<PFX>>;
|
||||||
|
|
||||||
|
|
@ -317,7 +317,7 @@ namespace engine {
|
||||||
|
|
||||||
/** type builder for FeedPrototype with remoulded parameter input */
|
/** type builder for FeedPrototype with remoulded parameter input */
|
||||||
template<class DEC>
|
template<class DEC>
|
||||||
using DecoratedPrototype = typename PROT::template Decorated<DEC>;
|
using DecoratedPrototype = PROT::template Decorated<DEC>;
|
||||||
template<class DEC>
|
template<class DEC>
|
||||||
using Decorated = WeavingBuilder<POL, DecoratedPrototype<DEC>>;
|
using Decorated = WeavingBuilder<POL, DecoratedPrototype<DEC>>;
|
||||||
|
|
||||||
|
|
@ -447,7 +447,7 @@ namespace engine {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using OutTypesDescriptors = typename PROT::template OutTypesApply<BufferDescriptor>;
|
using OutTypesDescriptors = PROT::template OutTypesApply<BufferDescriptor>;
|
||||||
using OutDescriptorTup = lib::meta::Tuple<OutTypesDescriptors>;
|
using OutDescriptorTup = lib::meta::Tuple<OutTypesDescriptors>;
|
||||||
|
|
||||||
/** A tuple of BufferDescriptor instances for all output buffer types */
|
/** A tuple of BufferDescriptor instances for all output buffer types */
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace fixture {
|
||||||
Segmentation::splitSplice (OptTime start, OptTime after, engine::ExitNodes&& modelLink)
|
Segmentation::splitSplice (OptTime start, OptTime after, engine::ExitNodes&& modelLink)
|
||||||
{
|
{
|
||||||
ASSERT (!start or !after or start != after);
|
ASSERT (!start or !after or start != after);
|
||||||
using Iter = typename list<Segment>::iterator;
|
using Iter = list<Segment>::iterator;
|
||||||
|
|
||||||
auto getStart = [](Iter elm) -> Time { return elm->start(); };
|
auto getStart = [](Iter elm) -> Time { return elm->start(); };
|
||||||
auto getAfter = [](Iter elm) -> Time { return elm->after(); };
|
auto getAfter = [](Iter elm) -> Time { return elm->after(); };
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace mobject {
|
||||||
using Rebinder = Rebind<OutputMappingMemberFunc>;
|
using Rebinder = Rebind<OutputMappingMemberFunc>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Target = typename Rebinder::Res;
|
using Target = Rebinder::Res;
|
||||||
|
|
||||||
};
|
};
|
||||||
}//(End) type rebinding helper
|
}//(End) type rebinding helper
|
||||||
|
|
@ -130,7 +130,7 @@ namespace mobject {
|
||||||
std::map<HashVal,HashVal> table_;
|
std::map<HashVal,HashVal> table_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Target = typename Setup::Target;
|
using Target = Setup::Target;
|
||||||
|
|
||||||
// using default ctor and copy operations
|
// using default ctor and copy operations
|
||||||
|
|
||||||
|
|
@ -317,7 +317,7 @@ namespace mobject {
|
||||||
* stored. Thus the yielded Resolver should be checked, if in doubt.
|
* stored. Thus the yielded Resolver should be checked, if in doubt.
|
||||||
*/
|
*/
|
||||||
template<class DEF>
|
template<class DEF>
|
||||||
inline typename OutputMapping<DEF>::Resolver
|
inline OutputMapping<DEF>::Resolver
|
||||||
OutputMapping<DEF>::operator[] (PId sourcePipeID)
|
OutputMapping<DEF>::operator[] (PId sourcePipeID)
|
||||||
{
|
{
|
||||||
if (not contains (sourcePipeID))
|
if (not contains (sourcePipeID))
|
||||||
|
|
@ -333,7 +333,7 @@ namespace mobject {
|
||||||
/** similar to the standard map-style access, but accepts
|
/** similar to the standard map-style access, but accepts
|
||||||
* a source pipe object instead of just a pipe-ID */
|
* a source pipe object instead of just a pipe-ID */
|
||||||
template<class DEF>
|
template<class DEF>
|
||||||
inline typename OutputMapping<DEF>::Resolver
|
inline OutputMapping<DEF>::Resolver
|
||||||
OutputMapping<DEF>::operator[] (PPipe const& pipe)
|
OutputMapping<DEF>::operator[] (PPipe const& pipe)
|
||||||
{
|
{
|
||||||
REQUIRE (pipe);
|
REQUIRE (pipe);
|
||||||
|
|
@ -372,7 +372,7 @@ namespace mobject {
|
||||||
* if in doubt.
|
* if in doubt.
|
||||||
*/
|
*/
|
||||||
template<class DEF>
|
template<class DEF>
|
||||||
inline typename OutputMapping<DEF>::Resolver
|
inline OutputMapping<DEF>::Resolver
|
||||||
OutputMapping<DEF>::operator[] (Query<asset::Pipe> query4pipe)
|
OutputMapping<DEF>::operator[] (Query<asset::Pipe> query4pipe)
|
||||||
{
|
{
|
||||||
HashVal hash4query = _mapping::slot (query4pipe);
|
HashVal hash4query = _mapping::slot (query4pipe);
|
||||||
|
|
|
||||||
|
|
@ -116,11 +116,11 @@ namespace mobject {
|
||||||
, public HashIndexed<Placement<MObject>, lib::hash::LuidH >
|
, public HashIndexed<Placement<MObject>, lib::hash::LuidH >
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
typedef HashIndexed<Placement<MObject>, lib::hash::LuidH> HashInd;
|
using HashInd = HashIndexed<Placement<MObject>, lib::hash::LuidH>;
|
||||||
typedef shared_ptr<MObject> _SmartPtr;
|
using _SmartPtr = shared_ptr<MObject>;
|
||||||
typedef void (*Deleter)(MObject*);
|
typedef void (*Deleter)(MObject*);
|
||||||
typedef lib::time::Time Time;
|
using Time = lib::time::Time;
|
||||||
typedef asset::shared_ptr<asset::Pipe> Pipe; ////TICKET #109 : get rid of this
|
using Pipe = asset::shared_ptr<asset::Pipe>; ////TICKET #109 : get rid of this
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -232,10 +232,10 @@ namespace mobject {
|
||||||
: public Placement<B>
|
: public Placement<B>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
typedef Placement<B> _Parent;
|
using _Parent = Placement<B>;
|
||||||
typedef typename _Parent::template Id<MO> const& _Id;
|
using _Id = _Parent::template Id<MO> const&;
|
||||||
typedef typename _Parent::Deleter Deleter;
|
using Deleter = _Parent::Deleter;
|
||||||
typedef typename _Parent::_SmartPtr _SmartPtr;
|
using _SmartPtr = _Parent::_SmartPtr;
|
||||||
|
|
||||||
|
|
||||||
Placement (MO & mo, Deleter killer)
|
Placement (MO & mo, Deleter killer)
|
||||||
|
|
@ -262,8 +262,8 @@ namespace mobject {
|
||||||
|
|
||||||
|
|
||||||
/** @todo cleanup uses of ref-to-placement. See Ticket #115 */
|
/** @todo cleanup uses of ref-to-placement. See Ticket #115 */
|
||||||
typedef Placement<MObject> PlacementMO;
|
using PlacementMO = Placement<MObject>;
|
||||||
typedef Placement<MObject> PMO;
|
using PMO = Placement<MObject>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,25 +50,25 @@ namespace session {
|
||||||
template<class MO>
|
template<class MO>
|
||||||
struct _PickRes<function<bool(Placement<MO> const&)> >
|
struct _PickRes<function<bool(Placement<MO> const&)> >
|
||||||
{
|
{
|
||||||
typedef MO Type;
|
using Type = MO;
|
||||||
typedef MORef<MO> Result;
|
using Result = MORef<MO>;
|
||||||
typedef typename ScopeQuery<MO>::iterator Iterator;
|
using Iterator = ScopeQuery<MO>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class MO>
|
template<class MO>
|
||||||
struct _PickRes<bool(&)(Placement<MO> const&)>
|
struct _PickRes<bool(&)(Placement<MO> const&)>
|
||||||
{
|
{
|
||||||
typedef MO Type;
|
using Type = MO;
|
||||||
typedef MORef<MO> Result;
|
using Result = MORef<MO>;
|
||||||
typedef typename ScopeQuery<MO>::iterator Iterator;
|
using Iterator = ScopeQuery<MO>::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class MO>
|
template<class MO>
|
||||||
struct _PickRes<bool(*)(Placement<MO> const&)>
|
struct _PickRes<bool(*)(Placement<MO> const&)>
|
||||||
{
|
{
|
||||||
typedef MO Type;
|
using Type = MO;
|
||||||
typedef MORef<MO> Result;
|
using Result = MORef<MO>;
|
||||||
typedef typename ScopeQuery<MO>::iterator Iterator;
|
using Iterator = ScopeQuery<MO>::iterator;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,11 +106,11 @@ namespace session {
|
||||||
* compiler error "no suitable function pick(.....)"
|
* compiler error "no suitable function pick(.....)"
|
||||||
*/
|
*/
|
||||||
template<typename PRED>
|
template<typename PRED>
|
||||||
typename _PickRes<PRED>::Result
|
_PickRes<PRED>::Result
|
||||||
pick (PRED const& searchPredicate)
|
pick (PRED const& searchPredicate)
|
||||||
{
|
{
|
||||||
typedef typename _PickRes<PRED>::Result ResultRef;
|
using ResultRef = _PickRes<PRED>::Result;
|
||||||
typedef typename _PickRes<PRED>::Iterator Iterator;
|
using Iterator = _PickRes<PRED>::Iterator;
|
||||||
|
|
||||||
Iterator iter (pickAllSuitable ( SessionServiceExploreScope::getScopeRoot()
|
Iterator iter (pickAllSuitable ( SessionServiceExploreScope::getScopeRoot()
|
||||||
, searchPredicate
|
, searchPredicate
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ namespace session {
|
||||||
bool remove (ID);
|
bool remove (ID);
|
||||||
|
|
||||||
template<class PLA>
|
template<class PLA>
|
||||||
typename BuildID<PLA>::Type insert (PLA const&, ID);
|
BuildID<PLA>::Type insert (PLA const&, ID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -318,10 +318,10 @@ namespace session {
|
||||||
* @todo is this API used in application code? or just used in tests?
|
* @todo is this API used in application code? or just used in tests?
|
||||||
*/
|
*/
|
||||||
template<class PLA>
|
template<class PLA>
|
||||||
typename BuildID<PLA>::Type
|
BuildID<PLA>::Type
|
||||||
PlacementIndex::insert (PLA const& newObj, ID targetScope)
|
PlacementIndex::insert (PLA const& newObj, ID targetScope)
|
||||||
{
|
{
|
||||||
typedef typename BuildID<PLA>::Target TargetMO;
|
using TargetMO = BuildID<PLA>::Target;
|
||||||
PlacementMO const& genericPlacement(newObj);
|
PlacementMO const& genericPlacement(newObj);
|
||||||
|
|
||||||
return find (insert (genericPlacement, targetScope))
|
return find (insert (genericPlacement, targetScope))
|
||||||
|
|
|
||||||
|
|
@ -119,11 +119,11 @@ namespace session {
|
||||||
|
|
||||||
|
|
||||||
template<class MO>
|
template<class MO>
|
||||||
typename ScopeQuery<MO>::iterator
|
ScopeQuery<MO>::iterator
|
||||||
query() const;
|
query() const;
|
||||||
|
|
||||||
template<class MO>
|
template<class MO>
|
||||||
typename ScopeQuery<MO>::iterator
|
ScopeQuery<MO>::iterator
|
||||||
explore() const;
|
explore() const;
|
||||||
|
|
||||||
lib::IterSource<const Scope>::iterator
|
lib::IterSource<const Scope>::iterator
|
||||||
|
|
@ -175,7 +175,7 @@ namespace session {
|
||||||
* within \em current focus. Resolution is
|
* within \em current focus. Resolution is
|
||||||
* delegated to the \em current session */
|
* delegated to the \em current session */
|
||||||
template<class MO>
|
template<class MO>
|
||||||
inline typename ScopeQuery<MO>::iterator
|
inline ScopeQuery<MO>::iterator
|
||||||
QueryFocus::query() const
|
QueryFocus::query() const
|
||||||
{
|
{
|
||||||
return ScopeLocator::instance().query<MO> (*this);
|
return ScopeLocator::instance().query<MO> (*this);
|
||||||
|
|
@ -186,7 +186,7 @@ namespace session {
|
||||||
* as immediate Child within \em current focus.
|
* as immediate Child within \em current focus.
|
||||||
* Resolution through \em current session */
|
* Resolution through \em current session */
|
||||||
template<class MO>
|
template<class MO>
|
||||||
inline typename ScopeQuery<MO>::iterator
|
inline ScopeQuery<MO>::iterator
|
||||||
QueryFocus::explore() const
|
QueryFocus::explore() const
|
||||||
{
|
{
|
||||||
return ScopeLocator::instance().explore<MO> (*this);
|
return ScopeLocator::instance().explore<MO> (*this);
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace session {
|
||||||
template<class STRU>
|
template<class STRU>
|
||||||
AnyPair entry_Struct(Literal caps)
|
AnyPair entry_Struct(Literal caps)
|
||||||
{
|
{
|
||||||
using Ptr = typename WrapReturn<STRU>::Wrapper;
|
using Ptr = WrapReturn<STRU>::Wrapper;
|
||||||
|
|
||||||
string capabilities (caps);
|
string capabilities (caps);
|
||||||
Query<STRU> query (capabilities);
|
Query<STRU> query (capabilities);
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ namespace session {
|
||||||
template<class TY, class BASE>
|
template<class TY, class BASE>
|
||||||
class LookupPreconfigured : public BASE
|
class LookupPreconfigured : public BASE
|
||||||
{
|
{
|
||||||
typedef typename WrapReturn<TY>::Wrapper Ret;
|
using Ret = WrapReturn<TY>::Wrapper;
|
||||||
|
|
||||||
/** (dummy) implementation of the QueryHandler interface */
|
/** (dummy) implementation of the QueryHandler interface */
|
||||||
virtual bool
|
virtual bool
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue