Skip to content

Commit

Permalink
Merge pull request #32 from jonathanpoelen/development
Browse files Browse the repository at this point in the history
fixed drop with N = 9, 10, 11, 12, 13, 14 or 15
  • Loading branch information
chieltbest authored Sep 21, 2017
2 parents b6c48ab + 8d9aa96 commit a4fef18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/kvasir/mpl/sequence/drop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ namespace kvasir {
struct drop_impl<8, C> {
template <unsigned N, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6, typename T7, typename... Ts>
using f = typename conditional<(sizeof...(Ts) <
1000000)>::template f<C, void>::template f<Ts...>;
using f = typename drop_impl<N-8, C>::template f<(N-8), Ts...>;
};
template <typename C>
struct drop_impl<16, C> {
Expand Down
5 changes: 5 additions & 0 deletions test/sequence/at.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ namespace {
namespace mpl = kvasir::mpl;

static_assert(std::is_same<mpl::eager::at<mpl::list<void, char, short>, 1>, char>::value, "");
static_assert(std::is_same<mpl::eager::at<mpl::list<int, int, int, int, int, int, int, void, char, short>, 7>, void>::value, "");
static_assert(std::is_same<mpl::eager::at<mpl::list<int, int, int, int, int, int, int, void, char, short>, 8>, char>::value, "");
static_assert(std::is_same<mpl::eager::at<mpl::list<int, int, int, int, int, int, int, void, char, short>, 9>, short>::value, "");
static_assert(std::is_same<mpl::eager::at<mpl::list<
int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, void, char, short>, 17>, char>::value, "");
}

0 comments on commit a4fef18

Please sign in to comment.