diff --git a/src/SQLiteC++/Column.h b/src/SQLiteC++/Column.h index e4aa8b3..d068ca4 100644 --- a/src/SQLiteC++/Column.h +++ b/src/SQLiteC++/Column.h @@ -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}’ 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 diff --git a/src/SQLiteC++/Database.cpp b/src/SQLiteC++/Database.cpp index b1baf3e..76fb4ae 100644 --- a/src/SQLiteC++/Database.cpp +++ b/src/SQLiteC++/Database.cpp @@ -82,4 +82,4 @@ void Database::check(const int aRet) const // throw(SQLite::Exception) } } -}; // namespace SQLite +} // namespace SQLite diff --git a/src/SQLiteC++/Statement.cpp b/src/SQLiteC++/Statement.cpp index e2cc5c2..1cd903d 100644 --- a/src/SQLiteC++/Statement.cpp +++ b/src/SQLiteC++/Statement.cpp @@ -223,4 +223,4 @@ void Statement::check(const int aRet) const // throw(SQLite::Exception) } } -}; // namespace SQLite +} // namespace SQLite