Missing fields in a data-form response are now interpreted as an empty value

This commit is contained in:
louiz’
2018-04-29 01:40:46 +02:00
parent efa63ee5cb
commit 7592d966e6
7 changed files with 49 additions and 11 deletions
+18 -3
View File
@@ -1,7 +1,5 @@
#pragma once
#include <utils/is_one_of.hpp>
#include <type_traits>
template <typename... T>
@@ -25,7 +23,24 @@ struct Row
return col.value;
}
public:
void clear()
{
this->clear_col<0>();
}
std::tuple<T...> columns;
std::string table_name;
private:
template <std::size_t N>
typename std::enable_if<N < sizeof...(T), void>::type
clear_col()
{
std::get<N>(this->columns).clear();
this->clear_col<N+1>();
}
template <std::size_t N>
typename std::enable_if<N == sizeof...(T), void>::type
clear_col()
{ }
};