Skip to content

Example doesn't work #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cizra opened this issue Apr 23, 2016 · 1 comment
Closed

Example doesn't work #46

cizra opened this issue Apr 23, 2016 · 1 comment

Comments

@cizra
Copy link

cizra commented Apr 23, 2016

I tried to compile the example that is currently in readme, and got these errors. My environment is
clang++:

Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
sqlite.cpp:36:12: error: invalid operands to binary expression ('sqlite::database' and 'const char16_t *')
        db << u"insert into user (age,name,weight) values (?,?,?);" // utf16 query string
        ~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:297:31: note: candidate function not viable: no known conversion from 'const char16_t [51]' to 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char> >') for 1st argument
                database_binder::chain_type operator<<(const std::string& sql) {
                                            ^
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:301:31: note: candidate function not viable: no known conversion from 'const char16_t [51]' to 'const char *' for 1st argument
                database_binder::chain_type operator<<(const char* sql) {
                                            ^
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:465:62: note: candidate function [with N = 51] not viable: no known conversion from 'sqlite::database' to 'database_binder::chain_type &' (aka 'unique_ptr<sqlite::database_binder> &') for 1st argument
        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); }
                                                                    ^
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:530:52: note: candidate function [with T = char16_t [51]] not viable: no known conversion from 'sqlite::database' to 'database_binder::chain_type' (aka 'unique_ptr<sqlite::database_binder>') for 1st argument
        template<typename T> database_binder::chain_type& operator << (database_binder::chain_type&& db, const T& val) { return db << val; }
                                                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:778:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:785:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:818:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:825:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:832:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:839:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:846:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:892:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:899:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:907:1: note: candidate template ignored: could not match 'basic_ostream<char, type-parameter-0-0>' against 'sqlite::database'
operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1077:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1094:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1101:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
^
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:433:59: note: candidate template ignored: could not match 'vector<type-parameter-0-0, allocator<type-parameter-0-0> >' against 'char16_t const[51]'
        template<typename T> inline database_binder::chain_type& operator<<(database_binder::chain_type& db, const std::vector<T>& vec) {
                                                                 ^
selkei/sneezymud/sqlite_modern_cpp/hdr/sqlite_modern_cpp.h:464:62: note: candidate template ignored: could not match 'const char' against 'const char16_t'
        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); }
                                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1063:5: note: candidate template ignored: disabled by 'enable_if' [with _Stream = sqlite::database &, _Tp = char16_t [51]]
    !is_lvalue_reference<_Stream>::value &&
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1086:1: note: candidate template ignored: could not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'sqlite::database'
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
^
1 error generated.
aminroosta added a commit that referenced this issue Apr 24, 2016
@aminroosta
Copy link
Collaborator

@cizra We have forgot to overload << operator for char16_t* and std::u16string.
It have fixed it now, thank you very much. if the issue persists (which shouldn't) please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants