Skip to content

Commit 4fa9351

Browse files
committed
Use nullopt instead of reset with experimental::optional
1 parent b071d2c commit 4fa9351

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,11 @@ namespace sqlite {
825825

826826
template <typename OptionalT> inline void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o) {
827827
if(sqlite3_column_type(db._stmt.get(), inx) == SQLITE_NULL) {
828+
#ifdef MODERN_SQLITE_EXPERIMENTAL_OPTIONAL_SUPPORT
829+
o = std::experimental::nullopt;
830+
#else
828831
o.reset();
832+
#endif
829833
} else {
830834
OptionalT v;
831835
get_col_from_db(db, inx, v);
@@ -834,7 +838,11 @@ namespace sqlite {
834838
}
835839
template <typename OptionalT> inline void get_val_from_db(sqlite3_value *value, optional<OptionalT>& o) {
836840
if(sqlite3_value_type(value) == SQLITE_NULL) {
841+
#ifdef MODERN_SQLITE_EXPERIMENTAL_OPTIONAL_SUPPORT
842+
o = std::experimental::nullopt;
843+
#else
837844
o.reset();
845+
#endif
838846
} else {
839847
OptionalT v;
840848
get_val_from_db(value, v);

0 commit comments

Comments
 (0)