Skip to content

Commit 3ef06a7

Browse files
add a few inlines to solve redefine symbole errors
1 parent f47c586 commit 3ef06a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ namespace sqlite {
464464
template<std::size_t N> inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const char(&STR)[N]) { return db << std::string(STR); }
465465
template<std::size_t N> inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const char16_t(&STR)[N]) { return db << std::u16string(STR); }
466466

467-
template<> database_binder::chain_type& operator <<(database_binder::chain_type& db, const std::string& txt) {
467+
template<> inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const std::string& txt) {
468468
int hresult;
469469
if((hresult = sqlite3_bind_text(db->_stmt.get(), db->_inx, txt.data(), -1, SQLITE_TRANSIENT)) != SQLITE_OK) {
470470
exceptions::throw_sqlite_error(hresult);
@@ -474,7 +474,7 @@ namespace sqlite {
474474
return db;
475475
}
476476
// std::u16string
477-
template<> void get_col_from_db(database_binder& db, int inx, std::u16string & w) {
477+
template<> inline void get_col_from_db(database_binder& db, int inx, std::u16string & w) {
478478
if(sqlite3_column_type(db._stmt.get(), inx) == SQLITE_NULL) {
479479
w = std::u16string();
480480
} else {
@@ -495,7 +495,7 @@ namespace sqlite {
495495
}
496496
// boost::optinal support for NULL values
497497
#ifdef _MODERN_SQLITE_BOOST_OPTIONAL_SUPPORT
498-
template <typename BoostOptionalT> database_binder::chain_type& operator <<(database_binder::chain_type& db, const boost::optional<BoostOptionalT>& val) {
498+
template <typename BoostOptionalT> inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const boost::optional<BoostOptionalT>& val) {
499499
if(val) {
500500
return operator << (std::move(db), std::move(*val));
501501
}
@@ -508,7 +508,7 @@ namespace sqlite {
508508
return db;
509509
}
510510

511-
template <typename BoostOptionalT> void get_col_from_db(database_binder& db, int inx, boost::optional<BoostOptionalT>& o) {
511+
template <typename BoostOptionalT> inline void get_col_from_db(database_binder& db, int inx, boost::optional<BoostOptionalT>& o) {
512512
if(sqlite3_column_type(db._stmt.get(), inx) == SQLITE_NULL) {
513513
o.reset();
514514
} else {
@@ -524,7 +524,7 @@ namespace sqlite {
524524
template<typename T> void operator >> (database_binder::chain_type&& db, T&& val) { db >> std::forward<T>(val); }
525525

526526
// Some ppl are lazy so we have a operator for proper prep. statemant handling.
527-
void operator++(database_binder::chain_type& db, int) { db->execute(); db->reset(); }
527+
void inline operator++(database_binder::chain_type& db, int) { db->execute(); db->reset(); }
528528

529529
// Convert the rValue binder to a reference and call first op<<, its needed for the call that creates the binder (be carfull of recursion here!)
530530
template<typename T> database_binder::chain_type& operator << (database_binder::chain_type&& db, const T& val) { return db << val; }

0 commit comments

Comments
 (0)