diff --git a/common/eda_pattern_match.cpp b/common/eda_pattern_match.cpp index 5251305857..80f95c919c 100644 --- a/common/eda_pattern_match.cpp +++ b/common/eda_pattern_match.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2017 Chris Pavlina <pavlina.chris@gmail.com> - * Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,7 +26,6 @@ #include <wx/log.h> #include <wx/tokenzr.h> #include <climits> -#include <make_unique.h> bool EDA_PATTERN_MATCH_SUBSTR::SetPattern( const wxString& aPattern ) { diff --git a/common/footprint_filter.cpp b/common/footprint_filter.cpp index 58bbafb5ed..bf6d063fe3 100644 --- a/common/footprint_filter.cpp +++ b/common/footprint_filter.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -19,7 +19,6 @@ */ #include <footprint_filter.h> -#include <make_unique.h> #include <stdexcept> using FOOTPRINT_FILTER_IT = FOOTPRINT_FILTER::ITERATOR; diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index ba52e63e0b..4e3c75a362 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -38,8 +38,6 @@ #include <md5_hash.h> #include <map> -#include <make_unique.h> - #include <geometry/geometry_utils.h> #include <geometry/shape.h> #include <geometry/shape_line_chain.h> diff --git a/common/lib_tree_model.cpp b/common/lib_tree_model.cpp index 71fe74c7dc..4cf23c2d01 100644 --- a/common/lib_tree_model.cpp +++ b/common/lib_tree_model.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com> * Copyright (C) 2014 Henner Zeller <h.zeller@acm.org> - * Copyright (C) 2014-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2014-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -23,7 +23,6 @@ #include <eda_pattern_match.h> #include <lib_tree_item.h> -#include <make_unique.h> #include <utility> #include <pgm_base.h> #include <kicad_string.h> diff --git a/common/view/zoom_controller.cpp b/common/view/zoom_controller.cpp index 95c21763f0..735cf24700 100644 --- a/common/view/zoom_controller.cpp +++ b/common/view/zoom_controller.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de * Copyright (C) 2013-2015 CERN - * Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012-2019 KiCad Developers, see AUTHORS.txt for contributors. * * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> * @author Maciej Suminski <maciej.suminski@cern.ch> @@ -28,7 +28,6 @@ #include <view/zoom_controller.h> -#include <make_unique.h> #include <trace_helpers.h> #include <wx/log.h> @@ -131,4 +130,4 @@ double CONSTANT_ZOOM_CONTROLLER::GetScaleForRotation( int aRotation ) constexpr ACCELERATING_ZOOM_CONTROLLER::TIMEOUT ACCELERATING_ZOOM_CONTROLLER::DEFAULT_TIMEOUT; constexpr double CONSTANT_ZOOM_CONTROLLER::MAC_SCALE; -constexpr double CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE; \ No newline at end of file +constexpr double CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE; diff --git a/common/widgets/wx_busy_indicator.cpp b/common/widgets/wx_busy_indicator.cpp index b7da24f761..141213f09d 100644 --- a/common/widgets/wx_busy_indicator.cpp +++ b/common/widgets/wx_busy_indicator.cpp @@ -23,11 +23,9 @@ #include <widgets/wx_busy_indicator.h> -#include <make_unique.h> - #include <wx/cursor.h> WX_BUSY_INDICATOR::WX_BUSY_INDICATOR() : m_cursor( std::make_unique<wxBusyCursor>() ) { -} \ No newline at end of file +} diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 119015173b..518c0bdd33 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -42,7 +42,6 @@ #include <html_messagebox.h> #include <reporter.h> #include <bom_plugins.h> -#include <make_unique.h> #include <dialogs/dialog_bom_cfg_lexer.h> diff --git a/include/common.h b/include/common.h index a3fd9f2924..563af17861 100644 --- a/include/common.h +++ b/include/common.h @@ -45,9 +45,6 @@ #include <atomic> #include <memory> -// C++11 "polyfill" for the C++14 std::make_unique function -#include "make_unique.h" - class wxAboutDialogInfo; class SEARCH_STACK; class REPORTER; diff --git a/include/make_unique.h b/include/make_unique.h deleted file mode 100644 index 1ef20658d0..0000000000 --- a/include/make_unique.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file make_unique.h - * @brief Implementation of std::make_unique for pre C++14 compilation - * environments - */ - -#ifndef MAKE_UNIQUE_H -#define MAKE_UNIQUE_H - -// Define std::make_unique if the compiler is C++11, but not C++14 -// (which provides this itself) -// When C++14 support is a KiCad pre-requisite, this entire file -// can be removed. -#if __cplusplus == 201103L - -#include <cstddef> -#include <memory> -#include <type_traits> -#include <utility> - -// It's a bit naughty to add things to std::, but the point is to -// "polyfill" this function in only if std:: doesn't have it -// -// This implementation is the one proposed by Stephan T. Lavavej -// in N3656: https://isocpp.org/files/papers/N3656.txt -// This is more or less exactly how it is implemented in GCC (e.g. 6.3.1) -// when C++14 is enabled. -namespace std -{ - template<class T> struct _Unique_if { - typedef unique_ptr<T> _Single_object; - }; - - template<class T> struct _Unique_if<T[]> { - typedef unique_ptr<T[]> _Unknown_bound; - }; - - template<class T, size_t N> struct _Unique_if<T[N]> { - typedef void _Known_bound; - }; - - /// std::make_unique for single objects - template<class T, class... Args> - typename _Unique_if<T>::_Single_object - make_unique(Args&&... args) { - return unique_ptr<T>(new T(std::forward<Args>(args)...)); - } - - /// std::make_unique for arrays of unknown bound - template<class T> - typename _Unique_if<T>::_Unknown_bound - make_unique(size_t n) { - typedef typename remove_extent<T>::type U; - return unique_ptr<T>(new U[n]()); - } - - /// Disable std::make_unique for arrays of known bound - template<class T, class... Args> - typename _Unique_if<T>::_Known_bound - make_unique(Args&&...) = delete; -} - -#endif // __cplusplus == 201103L - -#endif // WXSTRUCT_H_ diff --git a/libs/sexpr/sexpr_parser.cpp b/libs/sexpr/sexpr_parser.cpp index 3c3decd784..28fcd73464 100644 --- a/libs/sexpr/sexpr_parser.cpp +++ b/libs/sexpr/sexpr_parser.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 Mark Roszko <mark.roszko@gmail.com> - * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ #include <wx/file.h> #include <macros.h> -#include <make_unique.h> namespace SEXPR { diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index b6a6aed56b..ae1ecffad0 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2011 Jean-Pierre Charras, <jp.charras@wanadoo.fr> * Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -33,7 +33,6 @@ #include <kiway.h> #include <lib_id.h> #include <macros.h> -#include <make_unique.h> #include <pgm_base.h> #include <wildcards_and_files_ext.h> #include <widgets/progress_reporter.h> diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index 7fe93c96cc..9d90da91bb 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com> * Copyright (C) 2016 Tomasz Wlostowski <tomasz.wlostowski@cern.ch> * @@ -32,7 +32,6 @@ #include <mutex> #include <eda_draw_frame.h> #include <utility> -#include <make_unique.h> #include <colors_design_settings.h> #include <pcb_edit_frame.h> #include <wx/stattext.h> diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 0238f99eee..aa1a40aed6 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -38,7 +38,6 @@ #include <kiface_ids.h> #include <confirm.h> #include <macros.h> -#include <make_unique.h> #include <pcb_edit_frame.h> #include <eda_dde.h> #include <wx/stdpaths.h> diff --git a/qa/common/test_lib_table.cpp b/qa/common/test_lib_table.cpp index 3394524021..c754b26d5c 100644 --- a/qa/common/test_lib_table.cpp +++ b/qa/common/test_lib_table.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2018-2019 KiCad Developers, see CHANGELOG.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -35,8 +35,6 @@ // Code under test #include <lib_table_base.h> -#include <make_unique.h> - /** * A concrete implementation of #LIB_TABLE_ROW that implements