mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Fix Visual Studio 2010 and Visual Studio 2012 compilation
- fix an overload operator ambiguity under MSVC2010, that is required for GCC
This commit is contained in:
parent
cffc0ae0d0
commit
ede851eb3e
@ -62,11 +62,18 @@ public:
|
||||
{
|
||||
return getText();
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
// NOTE : the following is required by GCC to cast a Column result in a std::string
|
||||
// (error: conversion from ‘SQLite::Column’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested)
|
||||
// but is not working under Microsoft Visual Studio 2010 and 2012
|
||||
// (error C2440: 'initializing' : cannot convert from 'SQLite::Column' to 'std::basic_string<_Elem,_Traits,_Ax>'
|
||||
// [...] constructor overload resolution was ambiguous)
|
||||
/// Inline cast operator to std::string
|
||||
inline operator const std::string() const
|
||||
{
|
||||
return getText();
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Column is copyable, but copy should not be used elsewhere than in return form getColumn
|
||||
|
@ -82,4 +82,4 @@ void Database::check(const int aRet) const // throw(SQLite::Exception)
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace SQLite
|
||||
} // namespace SQLite
|
||||
|
@ -223,4 +223,4 @@ void Statement::check(const int aRet) const // throw(SQLite::Exception)
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace SQLite
|
||||
} // namespace SQLite
|
||||
|
Loading…
x
Reference in New Issue
Block a user