diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-04-22 15:13:33 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-04-22 15:13:33 +0100 |
commit | ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76 (patch) | |
tree | 78f3cc6ce79e1aad4da917865c4a2669aac90e93 /libodbcpp/odbc-selectcommand.cpp | |
parent | Mark potential fall-through (diff) | |
download | libdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.tar.bz2 libdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.tar.xz libdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.zip |
C++17libdbpp-odbc-1.2.0
Updates code largely in-keeping with updates to be C++17 in line with
libadhocutil and libdbpp.
Diffstat (limited to 'libodbcpp/odbc-selectcommand.cpp')
-rw-r--r-- | libodbcpp/odbc-selectcommand.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libodbcpp/odbc-selectcommand.cpp b/libodbcpp/odbc-selectcommand.cpp index e33b3da..6b28a32 100644 --- a/libodbcpp/odbc-selectcommand.cpp +++ b/libodbcpp/odbc-selectcommand.cpp @@ -43,7 +43,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset) if (SQL_SUCCEEDED(diagrc)) { if (!strncmp((const char*)sqlstatus, "01004", 5)) { for (Columns::iterator i = columns->begin(); i != columns->end(); ++i) { - boost::dynamic_pointer_cast<Column>(*i)->resize(); + std::dynamic_pointer_cast<Column>(*i)->resize(); } return fetch(SQL_FETCH_RELATIVE, 0); } @@ -57,7 +57,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset) { bool resized = false; for (Columns::iterator i = columns->begin(); i != columns->end(); ++i) { - resized |= boost::dynamic_pointer_cast<Column>(*i)->resize(); + resized |= std::dynamic_pointer_cast<Column>(*i)->resize(); } if (resized) { return fetch(SQL_FETCH_RELATIVE, 0); @@ -97,13 +97,13 @@ ODBC::SelectCommand::execute() case SQL_REAL: case SQL_FLOAT: case SQL_DOUBLE: - ncol = insertColumn(DB::ColumnPtr(new FloatingPointColumn(this, colName, col))); + ncol = insertColumn(std::make_shared<FloatingPointColumn>(this, colName, col)); break; case SQL_SMALLINT: case SQL_INTEGER: case SQL_TINYINT: case SQL_BIGINT: - ncol = insertColumn(DB::ColumnPtr(new SignedIntegerColumn(this, colName, col))); + ncol = insertColumn(std::make_shared<SignedIntegerColumn>(this, colName, col)); break; case SQL_TYPE_TIME: case SQL_INTERVAL_YEAR: @@ -119,21 +119,21 @@ ODBC::SelectCommand::execute() case SQL_INTERVAL_HOUR_TO_MINUTE: case SQL_INTERVAL_HOUR_TO_SECOND: case SQL_INTERVAL_MINUTE_TO_SECOND: - ncol = insertColumn(DB::ColumnPtr(new IntervalColumn(this, colName, col))); + ncol = insertColumn(std::make_shared<IntervalColumn>(this, colName, col)); break; case SQL_TIMESTAMP: case SQL_DATETIME: case SQL_TYPE_DATE: case SQL_TYPE_TIMESTAMP: - ncol = insertColumn(DB::ColumnPtr(new TimeStampColumn(this, colName, col))); + ncol = insertColumn(std::make_shared<TimeStampColumn>(this, colName, col)); break; case SQL_UNKNOWN_TYPE: throw DB::ColumnTypeNotSupported(); default: - ncol = insertColumn(DB::ColumnPtr(new CharArrayColumn(this, colName, col, bindSize))); + ncol = insertColumn(std::make_shared<CharArrayColumn>(this, colName, col, bindSize)); break; }; - boost::dynamic_pointer_cast<Column>(ncol)->bind(); + std::dynamic_pointer_cast<Column>(ncol)->bind(); } } |