47 using lib::meta::disable_if;
57 typedef typename lib::meta::Unwrap<T>::Type TaT;
74 typedef typename lib::meta::Unwrap<T>::Type TaT;
81 template<
typename COL>
83 __ensure_nonempty(COL
const& coll)
85 if (util::isnil(coll))
87 ,lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE);
100 template <
typename COLL,
typename = enable_if< treat_as_STL_Container<COLL>>>
104 using lib::meta::unwrap;
106 __ensure_nonempty(coll);
107 return *(unwrap(coll).begin());
115 template <
typename COLL,
typename = enable_if< can_direct_access_Last<COLL>>>
119 using lib::meta::unwrap;
121 __ensure_nonempty(coll);
122 return *(unwrap(coll).rbegin());
130 template <
typename IT,
typename = enable_if<treat_as_LumieraIterator<IT>>>
134 __ensure_nonempty(ii);
139 #ifdef LIB_ITERTOOLS_H 145 template <
typename IT,
typename = enable_if<treat_as_LumieraIterator<IT>>>
149 __ensure_nonempty(ii);
150 return lib::pull_last (ii);
162 using Val =
typename std::remove_reference_t<IT>::value_type;
163 Val res = std::numeric_limits<Val>::min();
164 for (
auto const& elm : std::forward<IT> (elms))
172 max (CON
const& elms)
174 using Val =
typename std::remove_reference_t<CON>::value_type;
175 Val res = std::numeric_limits<Val>::min();
176 for (
auto const& elm : elms)
187 using Val =
typename std::remove_reference_t<IT>::value_type;
188 Val res = std::numeric_limits<Val>::max();
189 for (
auto const& elm : std::forward<IT> (elms))
197 min (CON
const& elms)
199 using Val =
typename std::remove_reference_t<CON>::value_type;
200 Val res = std::numeric_limits<Val>::max();
201 for (
auto const& elm : elms)
auto first(COLL const &coll)
access the first element of a STL-like container.
auto last(COLL const &coll)
access the last element of a STL-like container.
Derived specific exceptions within Lumiera's exception hierarchy.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Helpers for type detection, type rewriting and metaprogramming.