From ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 22 Apr 2018 15:13:33 +0100 Subject: C++17 Updates code largely in-keeping with updates to be C++17 in line with libadhocutil and libdbpp. --- libodbcpp/odbc-selectcommand.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libodbcpp/odbc-selectcommand.cpp') 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(*i)->resize(); + std::dynamic_pointer_cast(*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(*i)->resize(); + resized |= std::dynamic_pointer_cast(*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(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(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(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(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(this, colName, col, bindSize)); break; }; - boost::dynamic_pointer_cast(ncol)->bind(); + std::dynamic_pointer_cast(ncol)->bind(); } } -- cgit v1.2.3