From d45ec996a34d2f129c11564fc4c72845de366595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Wed, 29 Apr 2015 10:19:19 +0200 Subject: [PATCH] Fix the example overload pb on GCC & Clang - uses explicit getText() instead of implicit conversion --- examples/example1/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/example1/main.cpp b/examples/example1/main.cpp index b243664..e94603a 100644 --- a/examples/example1/main.cpp +++ b/examples/example1/main.cpp @@ -123,11 +123,11 @@ int main () std::cout << "origin table 'test' [\"" << oname0.c_str() << "\", \"" << oname1.c_str() << "\", \"" << oname2.c_str() << "\"]\n"; #endif // Demonstrates how to get some typed column value (and the equivalent explicit call) - const int id = query.getColumn(0); // = query.getColumn(0).getInt() - //const char* pvalue = query.getColumn(1); // = query.getColumn(1).getText() - const std::string value2 = query.getColumn(1); // = query.getColumn(1).getText() + const int id = query.getColumn(0); // = query.getColumn(0).getInt(); + //const char* pvalue = query.getColumn(1); // = query.getColumn(1).getText(); + const std::string value2 = query.getColumn(1); // = query.getColumn(1).getText(); const int bytes = query.getColumn(1).getBytes(); - const double weight = query.getColumn(2); // = query.getColumn(2).getInt() + const double weight = query.getColumn(2); // = query.getColumn(2).getInt(); std::cout << "row (" << id << ", \"" << value2.c_str() << "\" " << bytes << " bytes, " << weight << ")\n"; } @@ -151,9 +151,9 @@ int main () double weight = 0.0; while (query.executeStep()) { - id = query.getColumn(0); // = query.getColumn(0).getInt() - value2 = query.getColumn(1); // = query.getColumn(1).getText() - weight = query.getColumn(2); // = query.getColumn(1).getInt() + id = query.getColumn(0).getInt(); + value2 = query.getColumn(1).getText(); + weight = query.getColumn(2).getInt(); std::cout << "row (" << id << ", \"" << value2 << "\", " << weight << ")\n"; } }