diff --git a/CMakeLists.txt b/CMakeLists.txt index d6b6bc62bbddc3b731885696b9d9c53766630037..f80b8e977697e1ab11c8bfcffea3e7e068724a09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,6 @@ SET(HDRS_PROCESSOR include/core/processor/processor_diff_drive.h include/core/processor/processor_fix_wing_model.h include/core/processor/factory_processor.h - include/core/processor/processor_logging.h include/core/processor/processor_loop_closure.h include/core/processor/processor_motion.h include/core/processor/processor_odom_2d.h @@ -252,7 +251,6 @@ SET(HDRS_UTILS include/core/utils/graph_search.h include/core/utils/loader.h include/core/utils/logging.h - include/core/utils/make_unique.h include/core/utils/params_server.h include/core/utils/singleton.h include/core/utils/utils_gtest.h diff --git a/include/core/utils/logging.h b/include/core/utils/logging.h index b34ceccb16c5e12567256f2749896d5369d017a8..a0e1556898fd453f5543ba90ec3645ccf282525c 100644 --- a/include/core/utils/logging.h +++ b/include/core/utils/logging.h @@ -222,16 +222,6 @@ inline void Logger::set_pattern(const std::string& p) using LoggerPtr = std::unique_ptr<Logger>; -/// dummy namespace to avoid colision with c++14 -/// @todo use std version once we move to cxx14 -namespace not_std { -template <typename T, typename... Args> -std::unique_ptr<T> make_unique(Args&&... args) -{ - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); -} -} /* namespace not_std */ - class LoggerManager { public: @@ -265,7 +255,7 @@ protected: /// @note would be easier with cpp17 map.try_emplace... const bool created = existsImpl(name) ? false : - logger_map_.emplace(name, not_std::make_unique<Logger>(name)).second; + logger_map_.emplace(name, std::make_unique<Logger>(name)).second; return created; } diff --git a/include/core/utils/make_unique.h b/include/core/utils/make_unique.h deleted file mode 100644 index 0bfdbb8372a54fb59d2ab59d8ca1b78432b38dec..0000000000000000000000000000000000000000 --- a/include/core/utils/make_unique.h +++ /dev/null @@ -1,45 +0,0 @@ -//--------LICENSE_START-------- -// -// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informà tica Industrial, CSIC-UPC. -// Authors: Joan Solà Ortega (jsola@iri.upc.edu) -// All rights reserved. -// -// This file is part of WOLF -// WOLF is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// -//--------LICENSE_END-------- -/** - * \file make_unique.h - * - * Created on: Oct 11, 2017 - * \author: Jeremie Deray - */ - -#ifndef _WOLF_MAKE_UNIQUE_H_ -#define _WOLF_MAKE_UNIQUE_H_ - -#include <memory> - -namespace wolf { - -/// @note this appears only in cpp14 -template <typename T, typename... Args> -std::unique_ptr<T> make_unique(Args&&... args) -{ - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); -} - -} - -#endif /* _WOLF_MAKE_UNIQUE_H_ */ diff --git a/src/ceres_wrapper/solver_ceres.cpp b/src/ceres_wrapper/solver_ceres.cpp index aed7fef36c99f71de9b664fa456620c7ef6523cd..ab8753351aee84c5b4f290af171b370663060499 100644 --- a/src/ceres_wrapper/solver_ceres.cpp +++ b/src/ceres_wrapper/solver_ceres.cpp @@ -27,7 +27,6 @@ #include "core/trajectory/trajectory_base.h" #include "core/map/map_base.h" #include "core/landmark/landmark_base.h" -#include "core/utils/make_unique.h" namespace wolf { @@ -47,8 +46,8 @@ SolverCeres::SolverCeres(const ProblemPtr& _wolf_problem, , n_interrupted_(0) , n_no_convergence_(0) { - covariance_ = wolf::make_unique<ceres::Covariance>(params_ceres_->covariance_options); - ceres_problem_ = wolf::make_unique<ceres::Problem>(params_ceres_->problem_options); + covariance_ = std::make_unique<ceres::Covariance>(params_ceres_->covariance_options); + ceres_problem_ = std::make_unique<ceres::Problem>(params_ceres_->problem_options); if (params_ceres_->interrupt_on_problem_change) getSolverOptions().callbacks.push_back(new IterationUpdateCallback(wolf_problem_,