Commit 92f5e465 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

SqliteTools: Add a nullptr traits

It only does binding a nullptr to sqlite, since we can't write to a
nullptr, nor can we assign nullptr to int/string/float/...
parent 4dd595da
......@@ -52,6 +52,15 @@ struct Traits<T, typename std::enable_if<std::is_floating_point<T>::value>::type
(*Load)(sqlite3_stmt *, int) = &sqlite3_column_double;
};
template <>
struct Traits<std::nullptr_t>
{
static int Bind(sqlite3_stmt* stmt, int idx, std::nullptr_t)
{
return sqlite3_bind_null( stmt, idx );
}
};
class SqliteTools
{
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