Skip to content

Commit 9475782

Browse files
committed
Made optional type available within the sqlite namespace
1 parent d1d5af1 commit 9475782

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
5353
#endif
5454

5555
namespace sqlite {
56+
57+
// std::optional support for NULL values
58+
#ifdef MODERN_SQLITE_STD_OPTIONAL_SUPPORT
59+
#ifdef MODERN_SQLITE_EXPERIMENTAL_OPTIONAL_SUPPORT
60+
template<class T>
61+
using optional = std::experimental::optional<T>;
62+
#else
63+
template<class T>
64+
using optional = std::optional<T>;
65+
#endif
66+
#endif
67+
5668
class database;
5769
class database_binder;
5870

@@ -247,13 +259,6 @@ namespace sqlite {
247259

248260

249261
#ifdef MODERN_SQLITE_STD_OPTIONAL_SUPPORT
250-
#ifdef MODERN_SQLITE_EXPERIMENTAL_OPTIONAL_SUPPORT
251-
template<class T>
252-
using optional = std::experimental::optional<T>;
253-
#else
254-
template<class T>
255-
using optional = std::optional<T>;
256-
#endif
257262
template <typename OptionalT> friend database_binder& operator <<(database_binder& db, const optional<OptionalT>& val);
258263
template <typename OptionalT> friend void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o);
259264
#endif

0 commit comments

Comments
 (0)