feat(util/list): add to_list from buffer
This commit is contained in:
parent
1797e2846f
commit
aedf74e80a
1 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,7 @@ Author: Leonardo de Moura
|
||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
#include "util/optional.h"
|
#include "util/optional.h"
|
||||||
#include "util/memory_pool.h"
|
#include "util/memory_pool.h"
|
||||||
|
#include "util/buffer.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
/**
|
/**
|
||||||
|
@ -200,6 +201,11 @@ to_list(It const & begin, It const & end,
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
list<T> to_list(buffer<T> const & b) {
|
||||||
|
return to_list(b.begin(), b.end());
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief Return <tt>reverse(to_list(begin, end))</tt> */
|
/** \brief Return <tt>reverse(to_list(begin, end))</tt> */
|
||||||
template<typename It> list<typename std::iterator_traits<It>::value_type> reverse_to_list(It const & begin, It const & end) {
|
template<typename It> list<typename std::iterator_traits<It>::value_type> reverse_to_list(It const & begin, It const & end) {
|
||||||
list<typename std::iterator_traits<It>::value_type> r;
|
list<typename std::iterator_traits<It>::value_type> r;
|
||||||
|
|
Loading…
Reference in a new issue