17 #ifndef AWALI_MISC_VECTOR_HH
18 # define AWALI_MISC_VECTOR_HH
26 namespace awali {
namespace sttc {
35 template <
typename Fun>
42 template<
typename Fun,
typename H,
typename... Ts>
45 std::vector<H>
const& h,
46 std::vector<Ts>
const&... ts)
49 cross([&](Ts
const&... ts2) { f(he, ts2...); }, ts...);
52 template<
typename Fun,
typename... Ts>
55 const std::tuple<Ts...>& ts)
60 template<
typename Fun,
typename... Ts,
size_t... I>
63 const std::tuple<Ts...>& ts,
66 cross(f, std::get<I>(ts)...);
70 template <
typename Cont>
71 std::vector<typename Cont::value_type>
74 return {cont.begin(), cont.end()};
78 template <
typename T,
typename Alloc>
81 find(
const std::vector<T, Alloc>& s,
const T& e)
82 ->
typename std::vector<T, Alloc>::const_iterator
84 return std::find(std::begin(s), std::end(s), e);
88 template <
typename T,
typename Alloc>
91 has(
const std::vector<T, Alloc>& s,
const T& e)
93 return find(s, e) != std::end(s);
ATTRIBUTE_PURE auto find(const std::vector< T, Alloc > &s, const T &e) -> typename std::vector< T, Alloc >::const_iterator
Convenience wrapper around std::find.
Definition: vector.hh:81
cross_sequences< Sequences... > cross_tuple(const std::tuple< Sequences... > &seqs)
Definition: cross.hh:264
bool has(const std::map< Key, Value, Compare, Alloc > &s, const Key &e)
Definition: map.hh:53
void cross_tuple_(Fun f, const std::tuple< Ts... > &ts, awali::internal::index_sequence< I... >)
Definition: vector.hh:62
cross_sequences< Sequences... > cross(Sequences &&... seqs)
Definition: cross.hh:257
std::vector< typename Cont::value_type > to_vector(const Cont &cont)
Return the content of cont as a vector.
Definition: vector.hh:72
Main namespace of Awali.
Definition: ato.hh:22