diff options
Diffstat (limited to 'hkutil/database.h')
-rw-r--r-- | hkutil/database.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/hkutil/database.h b/hkutil/database.h index a2217e6..f4e7a9a 100644 --- a/hkutil/database.h +++ b/hkutil/database.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <cstring> | 10 | #include <cstring> |
11 | #include <list> | 11 | #include <list> |
12 | #include <memory> | 12 | #include <memory> |
13 | #include "../vendor/variant.hpp" | 13 | #include <variant> |
14 | #include "string.h" | 14 | #include "string.h" |
15 | 15 | ||
16 | namespace hatkirby { | 16 | namespace hatkirby { |
@@ -47,7 +47,7 @@ namespace hatkirby { | |||
47 | using blob_type = std::vector<unsigned char>; | 47 | using blob_type = std::vector<unsigned char>; |
48 | 48 | ||
49 | using binding = | 49 | using binding = |
50 | mpark::variant< | 50 | std::variant< |
51 | std::string, | 51 | std::string, |
52 | int, | 52 | int, |
53 | double, | 53 | double, |
@@ -338,18 +338,18 @@ namespace hatkirby { | |||
338 | int i, | 338 | int i, |
339 | const binding& value) | 339 | const binding& value) |
340 | { | 340 | { |
341 | if (mpark::holds_alternative<int>(value)) | 341 | if (std::holds_alternative<int>(value)) |
342 | { | 342 | { |
343 | if (sqlite3_bind_int( | 343 | if (sqlite3_bind_int( |
344 | ppstmt.get(), | 344 | ppstmt.get(), |
345 | i, | 345 | i, |
346 | mpark::get<int>(value)) != SQLITE_OK) | 346 | std::get<int>(value)) != SQLITE_OK) |
347 | { | 347 | { |
348 | throw sqlite3_error("Error preparing statement", ppdb_.get()); | 348 | throw sqlite3_error("Error preparing statement", ppdb_.get()); |
349 | } | 349 | } |
350 | } else if (mpark::holds_alternative<std::string>(value)) | 350 | } else if (std::holds_alternative<std::string>(value)) |
351 | { | 351 | { |
352 | const std::string& arg = mpark::get<std::string>(value); | 352 | const std::string& arg = std::get<std::string>(value); |
353 | 353 | ||
354 | if (sqlite3_bind_text( | 354 | if (sqlite3_bind_text( |
355 | ppstmt.get(), | 355 | ppstmt.get(), |
@@ -360,24 +360,24 @@ namespace hatkirby { | |||
360 | { | 360 | { |
361 | throw sqlite3_error("Error preparing statement", ppdb_.get()); | 361 | throw sqlite3_error("Error preparing statement", ppdb_.get()); |
362 | } | 362 | } |
363 | } else if (mpark::holds_alternative<double>(value)) | 363 | } else if (std::holds_alternative<double>(value)) |
364 | { | 364 | { |
365 | if (sqlite3_bind_double( | 365 | if (sqlite3_bind_double( |
366 | ppstmt.get(), | 366 | ppstmt.get(), |
367 | i, | 367 | i, |
368 | mpark::get<double>(value)) != SQLITE_OK) | 368 | std::get<double>(value)) != SQLITE_OK) |
369 | { | 369 | { |
370 | throw sqlite3_error("Error preparing statement", ppdb_.get()); | 370 | throw sqlite3_error("Error preparing statement", ppdb_.get()); |
371 | } | 371 | } |
372 | } else if (mpark::holds_alternative<std::nullptr_t>(value)) | 372 | } else if (std::holds_alternative<std::nullptr_t>(value)) |
373 | { | 373 | { |
374 | if (sqlite3_bind_null(ppstmt.get(), i) != SQLITE_OK) | 374 | if (sqlite3_bind_null(ppstmt.get(), i) != SQLITE_OK) |
375 | { | 375 | { |
376 | throw sqlite3_error("Error preparing statement", ppdb_.get()); | 376 | throw sqlite3_error("Error preparing statement", ppdb_.get()); |
377 | } | 377 | } |
378 | } else if (mpark::holds_alternative<blob_type>(value)) | 378 | } else if (std::holds_alternative<blob_type>(value)) |
379 | { | 379 | { |
380 | const blob_type& arg = mpark::get<blob_type>(value); | 380 | const blob_type& arg = std::get<blob_type>(value); |
381 | 381 | ||
382 | if (sqlite3_bind_blob( | 382 | if (sqlite3_bind_blob( |
383 | ppstmt.get(), | 383 | ppstmt.get(), |