56 using lib::meta::disable_if;
66 typedef typename lib::meta::Unwrap<T>::Type TaT;
83 typedef typename lib::meta::Unwrap<T>::Type TaT;
90 template<
typename COL>
92 __ensure_nonempty(COL
const& coll)
94 if (util::isnil(coll))
96 ,lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE);
109 template <
typename COLL>
110 inline enable_if< treat_as_STL_Container<COLL>,
111 typename COLL::reference >
114 using lib::meta::unwrap;
116 __ensure_nonempty(coll);
117 return *(unwrap(coll).begin());
125 template <
typename COLL>
126 inline enable_if< can_direct_access_Last<COLL>,
127 typename COLL::reference >
130 using lib::meta::unwrap;
132 __ensure_nonempty(coll);
133 return *(unwrap(coll).rbegin());
141 template <
typename IT>
142 inline enable_if< treat_as_LumieraIterator<IT>,
143 typename IT::reference >
146 __ensure_nonempty(ii);
151 #ifdef LIB_ITERTOOLS_H 157 template <
typename IT>
158 inline enable_if< treat_as_LumieraIterator<IT>,
159 typename IT::value_type >
162 __ensure_nonempty(ii);
163 return lib::pull_last (ii);
175 using Val =
typename std::remove_reference_t<IT>::value_type;
176 Val res = std::numeric_limits<Val>::min();
177 for (
auto const& elm : std::forward<IT> (elms))
185 max (CON
const& elms)
187 using Val =
typename std::remove_reference_t<CON>::value_type;
188 Val res = std::numeric_limits<Val>::min();
189 for (
auto const& elm : elms)
200 using Val =
typename std::remove_reference_t<IT>::value_type;
201 Val res = std::numeric_limits<Val>::max();
202 for (
auto const& elm : std::forward<IT> (elms))
210 min (CON
const& elms)
212 using Val =
typename std::remove_reference_t<CON>::value_type;
213 Val res = std::numeric_limits<Val>::max();
214 for (
auto const& elm : elms)
enable_if< treat_as_STL_Container< COLL >, typename COLL::reference > first(COLL const &coll)
access the first 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.
enable_if< can_direct_access_Last< COLL >, typename COLL::reference > last(COLL const &coll)
access the last element of a STL-like container.