From 3ef06a7e6047cac0af264c41cdb1e7e2d300c61c Mon Sep 17 00:00:00 2001 From: Mordechai maman Date: Wed, 16 Mar 2016 02:31:28 +0200 Subject: [PATCH] add a few inlines to solve redefine symbole errors --- hdr/sqlite_modern_cpp.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hdr/sqlite_modern_cpp.h b/hdr/sqlite_modern_cpp.h index b9654f86..66b5a7f2 100644 --- a/hdr/sqlite_modern_cpp.h +++ b/hdr/sqlite_modern_cpp.h @@ -464,7 +464,7 @@ namespace sqlite { template inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const char(&STR)[N]) { return db << std::string(STR); } template inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const char16_t(&STR)[N]) { return db << std::u16string(STR); } - template<> database_binder::chain_type& operator <<(database_binder::chain_type& db, const std::string& txt) { + template<> inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const std::string& txt) { int hresult; if((hresult = sqlite3_bind_text(db->_stmt.get(), db->_inx, txt.data(), -1, SQLITE_TRANSIENT)) != SQLITE_OK) { exceptions::throw_sqlite_error(hresult); @@ -474,7 +474,7 @@ namespace sqlite { return db; } // std::u16string - template<> void get_col_from_db(database_binder& db, int inx, std::u16string & w) { + template<> inline void get_col_from_db(database_binder& db, int inx, std::u16string & w) { if(sqlite3_column_type(db._stmt.get(), inx) == SQLITE_NULL) { w = std::u16string(); } else { @@ -495,7 +495,7 @@ namespace sqlite { } // boost::optinal support for NULL values #ifdef _MODERN_SQLITE_BOOST_OPTIONAL_SUPPORT - template database_binder::chain_type& operator <<(database_binder::chain_type& db, const boost::optional& val) { + template inline database_binder::chain_type& operator <<(database_binder::chain_type& db, const boost::optional& val) { if(val) { return operator << (std::move(db), std::move(*val)); } @@ -508,7 +508,7 @@ namespace sqlite { return db; } - template void get_col_from_db(database_binder& db, int inx, boost::optional& o) { + template inline void get_col_from_db(database_binder& db, int inx, boost::optional& o) { if(sqlite3_column_type(db._stmt.get(), inx) == SQLITE_NULL) { o.reset(); } else { @@ -524,7 +524,7 @@ namespace sqlite { template void operator >> (database_binder::chain_type&& db, T&& val) { db >> std::forward(val); } // Some ppl are lazy so we have a operator for proper prep. statemant handling. - void operator++(database_binder::chain_type& db, int) { db->execute(); db->reset(); } + void inline operator++(database_binder::chain_type& db, int) { db->execute(); db->reset(); } // 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!) template database_binder::chain_type& operator << (database_binder::chain_type&& db, const T& val) { return db << val; }