Vcsn  2.4
Be Rational
queue.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <queue>
4 
5 #include <boost/range/algorithm/find.hpp>
6 
8 
9 namespace vcsn
10 {
11  namespace detail
12  {
14  template <typename Range>
15  std::queue<typename Range::value_type>
16  make_queue(const Range& range)
17  {
18  auto res = std::queue<typename Range::value_type>{};
19  for (auto s: range)
20  res.emplace(s);
21  return res;
22  }
23  }
24 
26  template <typename T, typename Container>
27  ATTRIBUTE_PURE
28  bool
29  has(const std::queue<T, Container>& s, const T& e)
30  {
31  return boost::find(s, e) != std::end(s);
32  }
33 }
std::queue< typename Range::value_type > make_queue(const Range &range)
The content of cont as a queue.
Definition: queue.hh:16
return res
Definition: multiply.hh:398
Definition: a-star.hh:8
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
Definition: setalpha.hh:25