Skip to content
Snippets Groups Projects
Commit cfed1b3d authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix undefined reference to allocator::allocator()

parent d916f499
No related branches found
No related tags found
No related merge requests found
Pipeline #
/*
* allocFix.hpp
*
* Created on: Mar 6, 2018
* Author: Jan Travnicek
*/
#ifndef __ALLOC_FIX_HPP_
#define __ALLOC_FIX_HPP_
namespace ext {
template < class Alloc >
class AllocFix {
public:
AllocFix ( ) {
static Alloc alloc;
}
};
} /* namespace ext */
#endif /* __ALLOC_FIX_HPP_ */
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < class T, class Alloc = std::allocator < T > > template < class T, class Alloc = std::allocator < T > >
class deque : public std::deque < T, Alloc > { class deque : public std::deque < T, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::deque < T, Alloc >::deque; using std::deque < T, Alloc >::deque;
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < class T, class Alloc = std::allocator < T > > template < class T, class Alloc = std::allocator < T > >
class forward_list : public std::forward_list < T, Alloc > { class forward_list : public std::forward_list < T, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::forward_list < T, Alloc >::forward_list; using std::forward_list < T, Alloc >::forward_list;
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < class T, class Alloc = std::allocator < T > > template < class T, class Alloc = std::allocator < T > >
class list : public std::list < T, Alloc > { class list : public std::list < T, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::list < T, Alloc >::list; using std::list < T, Alloc >::list;
......
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
   
#include "compare.hpp" #include "compare.hpp"
#include "pair.hpp" #include "pair.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < typename T, typename R, typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > > > 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 > { class map : public std::map < T, R, Cmp, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::map< T, R, Cmp, Alloc >::map; using std::map< T, R, Cmp, Alloc >::map;
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < typename T, typename Cmp = std::less < >, typename Alloc = std::allocator < T > > template < typename T, typename Cmp = std::less < >, typename Alloc = std::allocator < T > >
class set : public std::set < T, Cmp, Alloc > { class set : public std::set < T, Cmp, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::set < T, Cmp, Alloc >::set; using std::set < T, Cmp, Alloc >::set;
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
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 > > > 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 > { class unordered_map : public std::unordered_map < T, R, Hash, KeyEqual, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::unordered_map; using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::unordered_map;
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
#include <string> #include <string>
   
#include "compare.hpp" #include "compare.hpp"
#include "allocFix.hpp"
   
namespace ext { namespace ext {
   
template < class T, class Alloc = std::allocator < T > > template < class T, class Alloc = std::allocator < T > >
class vector : public std::vector < T, Alloc > { class vector : public std::vector < T, Alloc >, AllocFix < Alloc > {
public: public:
#ifdef __clang__ #ifdef __clang__
using std::vector< T, Alloc >::vector; using std::vector< T, Alloc >::vector;
......
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