Commit 0cf87a23 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

SqliteTools: Provide an int64 traits

parent c7d5c974
......@@ -30,9 +30,10 @@ template <typename T, typename Enable = void>
struct Traits;
template <typename T>
struct Traits<T, typename std::enable_if<std::is_integral<
typename std::decay<T>::type
>::value>::type>
struct Traits<T, typename std::enable_if<
std::is_integral<typename std::decay<T>::type>::value
&& ! IsSameDecay<T, int64_t>::value
>::type>
{
static constexpr
int (*Bind)(sqlite3_stmt *, int, int) = &sqlite3_bind_int;
......@@ -90,6 +91,16 @@ struct Traits<std::nullptr_t>
}
};
template <typename T>
struct Traits<T, typename std::enable_if<IsSameDecay<T, int64_t>::value>::type>
{
static constexpr int
(*Bind)(sqlite3_stmt *, int, sqlite_int64) = &sqlite3_bind_int64;
static constexpr sqlite_int64
(*Load)(sqlite3_stmt *, int) = &sqlite3_column_int64;
};
class Tools
{
private:
......
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