diff --git a/alib2std/src/extensions/allocFix.hpp b/alib2std/src/extensions/allocFix.hpp deleted file mode 100644 index 8ded1be51514b4a458fe1125911f3bb286315ca7..0000000000000000000000000000000000000000 --- a/alib2std/src/extensions/allocFix.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * allocFix.hpp - * - * This file is part of Algorithms library toolkit. - * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz) - - * Algorithms library toolkit 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 3 of the License, or - * (at your option) any later version. - - * Algorithms library toolkit 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 Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>. - * - * Created on: Mar 6, 2018 - * Author: Jan Travnicek - */ - -#ifndef __ALLOC_FIX_HPP_ -#define __ALLOC_FIX_HPP_ - -// related to issue with 'undefined reference to allocator < ... >::allocator ( )', subject of a delete when g++ fixes the issue -// the undefined reference occurs when one inherits from a class whose constructor has default value for the allocator -// I guess the default parameter construction (allocator constructor) should be inlined but it isn't. Its code is not emited either. - -namespace ext { - -/** - * \brief - * Class implementing the fix of undefined allocator - * - * TODO test if later versions of g++ are no longer affected. - */ -template < class Alloc > -class AllocFix { -public: - /** - * \brief - * Constructor to make sure the default constructor of given Allocator exists. - */ - AllocFix ( ) { - // just to make sure the allocator constructor exists - static Alloc alloc; - (void) alloc; // make unused variable warning go away - } -}; - -} /* namespace ext */ - -#endif /* __ALLOC_FIX_HPP_ */ diff --git a/alib2std/src/extensions/container/deque.hpp b/alib2std/src/extensions/container/deque.hpp index 25758c7d6c4fa571581f96a9c07ca99a4c1e89c5..4be95b0488bed4de785dc0a94b32b9dc2632631f 100644 --- a/alib2std/src/extensions/container/deque.hpp +++ b/alib2std/src/extensions/container/deque.hpp @@ -30,7 +30,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -45,7 +44,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < class T, class Alloc = std::allocator < T > > -class deque : public std::deque < T, Alloc >, AllocFix < Alloc > { +class deque : public std::deque < T, Alloc > { public: /** * Inherit constructors of the standard deque diff --git a/alib2std/src/extensions/container/forward_list.hpp b/alib2std/src/extensions/container/forward_list.hpp index 2bec99709005b4617276d6269a1c35ab66dd783c..4aeea8f14717dd6d9eed3e41efacf9f42ef9f0fe 100644 --- a/alib2std/src/extensions/container/forward_list.hpp +++ b/alib2std/src/extensions/container/forward_list.hpp @@ -30,7 +30,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { diff --git a/alib2std/src/extensions/container/list.hpp b/alib2std/src/extensions/container/list.hpp index 0c2a04600b87e0c7edf2885db6fd5e37a0491e90..56225afbd86b02a562b036e1045e57f5d51d14f8 100644 --- a/alib2std/src/extensions/container/list.hpp +++ b/alib2std/src/extensions/container/list.hpp @@ -30,7 +30,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -45,7 +44,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < class T, class Alloc = std::allocator < T > > -class list : public std::list < T, Alloc >, AllocFix < Alloc > { +class list : public std::list < T, Alloc > { public: /** * Inherit constructors of the standard list diff --git a/alib2std/src/extensions/container/map.hpp b/alib2std/src/extensions/container/map.hpp index 9ba8c3fd430be9691a9dd91b4a9e2f803c9cb112..37d095dbfecb2bafb3a935fb7e9e6b3717e0598f 100644 --- a/alib2std/src/extensions/container/map.hpp +++ b/alib2std/src/extensions/container/map.hpp @@ -33,7 +33,6 @@ #include "pair.hpp" #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -50,7 +49,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < typename T, typename R, typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > > > -class map : public std::map < T, R, Cmp, Alloc >, AllocFix < Alloc > { +class map : public std::map < T, R, Cmp, Alloc > { public: /** * Inherit constructors of the standard map diff --git a/alib2std/src/extensions/container/multimap.hpp b/alib2std/src/extensions/container/multimap.hpp index d999f538949d76ee9c6f18a3f467a1d21d525d19..4cc99ccdb884356de0b5672cbbbab9caf4deaff0 100644 --- a/alib2std/src/extensions/container/multimap.hpp +++ b/alib2std/src/extensions/container/multimap.hpp @@ -33,7 +33,6 @@ #include "pair.hpp" #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -50,7 +49,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < typename T, typename R, typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > > > -class multimap : public std::multimap < T, R, Cmp, Alloc >, AllocFix < Alloc > { +class multimap : public std::multimap < T, R, Cmp, Alloc > { public: /** * Inherit constructors of the standard multimap diff --git a/alib2std/src/extensions/container/ptr_vector.hpp b/alib2std/src/extensions/container/ptr_vector.hpp index e8eb52d8c12144a66a7af4dc1ab5678d704cff20..a898c7e0758f2f4028b3b46fa7c85e0b02a873ec 100644 --- a/alib2std/src/extensions/container/ptr_vector.hpp +++ b/alib2std/src/extensions/container/ptr_vector.hpp @@ -29,7 +29,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> #include <extensions/clone.hpp> #include <extensions/container/vector.hpp> diff --git a/alib2std/src/extensions/container/set.hpp b/alib2std/src/extensions/container/set.hpp index bd7ace0b5153fb7626a28e43c9e3018e290cc322..e2fb7803cee8b3245d55e2ec29eed06d8b412222 100644 --- a/alib2std/src/extensions/container/set.hpp +++ b/alib2std/src/extensions/container/set.hpp @@ -30,7 +30,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -45,7 +44,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < typename T, typename Cmp = std::less < >, typename Alloc = std::allocator < T > > -class set : public std::set < T, Cmp, Alloc >, AllocFix < Alloc > { +class set : public std::set < T, Cmp, Alloc > { public: /** * Inherit constructors of the standard set diff --git a/alib2std/src/extensions/container/unordered_map.hpp b/alib2std/src/extensions/container/unordered_map.hpp index a25d4179817a1efde70afd39f5489c5e96160518..96be42cbde29b3ed511ebe84d4a7be6bcc3ed1a2 100644 --- a/alib2std/src/extensions/container/unordered_map.hpp +++ b/alib2std/src/extensions/container/unordered_map.hpp @@ -30,7 +30,6 @@ #include <string> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -48,7 +47,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < class T, class R, class Hash = std::hash < T >, class KeyEqual = std::equal_to < T >, class Alloc = std::allocator < std::pair < const T, R > > > -class unordered_map : public std::unordered_map < T, R, Hash, KeyEqual, Alloc >, AllocFix < Alloc > { +class unordered_map : public std::unordered_map < T, R, Hash, KeyEqual, Alloc > { public: /** * Inherit constructors of the standard unordered_map diff --git a/alib2std/src/extensions/container/vector.hpp b/alib2std/src/extensions/container/vector.hpp index dbbad46166f34817f4443105859182ea95bf1624..8c2e28e883cb8b2f777898b22c63f1551685cb70 100644 --- a/alib2std/src/extensions/container/vector.hpp +++ b/alib2std/src/extensions/container/vector.hpp @@ -31,7 +31,6 @@ #include <iostream> #include <extensions/compare.hpp> -#include <extensions/allocFix.hpp> #include <extensions/range.hpp> namespace ext { @@ -46,7 +45,7 @@ namespace ext { * \tparam Alloc the allocator of values of type T */ template < class T, class Alloc = std::allocator < T > > -class vector : public std::vector < T, Alloc >, AllocFix < Alloc > { +class vector : public std::vector < T, Alloc > { public: /** * Inherit constructors of the standard vector