Commit 757009ec authored by Dominik Charousset's avatar Dominik Charousset

added tl_right meta function

parent 3e1f442d
...@@ -844,6 +844,21 @@ struct tl_is_distinct { ...@@ -844,6 +844,21 @@ struct tl_is_distinct {
tl_size<L>::value == tl_size<typename tl_distinct<L>::type>::value; tl_size<L>::value == tl_size<typename tl_distinct<L>::type>::value;
}; };
/**
* @brief Creates a new list containing the last @p N elements.
*/
template<class List, size_t N>
struct tl_right {
static constexpr size_t list_size = tl_size<List>::value;
static constexpr size_t first_idx = (list_size > N) ? (list_size - N) : 0;
typedef typename tl_slice<List, first_idx, list_size>::type type;
};
template<size_t N>
struct tl_right<empty_type_list, N> {
typedef empty_type_list type;
};
// list resize(list, size, fill_type) // list resize(list, size, fill_type)
template<class List, bool OldSizeLessNewSize, template<class List, bool OldSizeLessNewSize,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment