Skip to content
Snippets Groups Projects
Commit bac7d6c5 authored by Steven Murray's avatar Steven Murray
Browse files

Temporarily added cta::make_unique until we get a new enough compiler

parent 09278d84
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@
#pragma once
#include<memory>
namespace cta {
/**
......@@ -28,8 +30,8 @@ namespace cta {
* created on the heap and wrapped by an std::unique_ptr.
* @return The std::unique_ptr.
*/
template<typename T, typename... Ts> std::unique_ptr<T> make_unique(Tss&&... params) {
return std::unique_ptr<T>(new T(std::foward<Ts>(params)...));
template<typename T, typename... Ts> std::unique_ptr<T> make_unique(Ts&&... params) {
return std::unique_ptr<T>(new T(std::forward<Ts>(params)...));
}
} // namespace cta
......@@ -17,6 +17,7 @@
*/
#include "common/exception/Exception.hpp"
#include "common/make_unique.hpp"
#include "rdbms/ConnFactoryFactory.hpp"
#include "rdbms/OcciConnFactory.hpp"
#include "rdbms/SqliteConnFactory.hpp"
......@@ -31,11 +32,11 @@ std::unique_ptr<ConnFactory> ConnFactoryFactory::create(const Login &login) {
try {
switch(login.dbType) {
case rdbms::Login::DBTYPE_IN_MEMORY:
return std::unique_ptr<SqliteConnFactory>(new SqliteConnFactory(":memory:"));
return make_unique<SqliteConnFactory>(":memory:");
case rdbms::Login::DBTYPE_ORACLE:
return std::unique_ptr<OcciConnFactory>(new OcciConnFactory(login.username, login.password, login.database));
return make_unique<OcciConnFactory>(login.username, login.password, login.database);
case rdbms::Login::DBTYPE_SQLITE:
return std::unique_ptr<SqliteConnFactory>(new SqliteConnFactory(login.database));
return make_unique<SqliteConnFactory>(login.database);
case rdbms::Login::DBTYPE_NONE:
throw exception::Exception("Cannot create a catalogue without a database type");
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment