Skip to content
Snippets Groups Projects
Commit 6dbe2ca8 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Update fix #8 by removing the assumption that size_t is unsigned.

parent de13e1c9
No related branches found
No related tags found
1 merge request!9Fuse bn
Pipeline #31698 failed
......@@ -140,10 +140,10 @@ public:
}
template <typename R, std::size_t SIZE = std::tuple_size<std::tuple<T...>>::value-1>
constexpr typename std::enable_if<(SIZE < std::numeric_limits<std::size_t>::max()), R&>::type get(std::size_t i) {
if (i == SIZE) {
if (std::is_same<R, typename std::tuple_element<SIZE,std::tuple<T...>>::type>::value) {
return reinterpret_cast<R&>(std::get<SIZE>(mParams));
constexpr typename std::enable_if<(SIZE > 0), R&>::type get(std::size_t i) {
if (i == SIZE-1) {
if (std::is_same<R, typename std::tuple_element<SIZE-1,std::tuple<T...>>::type>::value) {
return reinterpret_cast<R&>(std::get<SIZE-1>(mParams));
}
else {
assert(false && "wrong parameter type");
......@@ -155,7 +155,7 @@ public:
}
template <typename R, std::size_t SIZE = std::tuple_size<std::tuple<T...>>::value-1>
constexpr typename std::enable_if<(SIZE == std::numeric_limits<std::size_t>::max()), R&>::type get(std::size_t /*i*/) {
constexpr typename std::enable_if<(SIZE == 0), R&>::type get(std::size_t /*i*/) {
assert(false && "parameter not found");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment