Skip to content
Snippets Groups Projects
Commit b7db8def authored by Radovan Červený's avatar Radovan Červený
Browse files

removed stealth_allocator ofstream operator, made vector.hpp operators allocator indifferent

parent 091cd04d
No related branches found
No related tags found
1 merge request!14BP_cervera3 - new measurements
...@@ -46,22 +46,6 @@ std::string to_string ( stealth_string & ); ...@@ -46,22 +46,6 @@ std::string to_string ( stealth_string & );
template < typename T > template < typename T >
using stealth_vector = std::vector < T, stealth_allocator < T > >; using stealth_vector = std::vector < T, stealth_allocator < T > >;
   
template < typename T >
std::ostream & operator <<( std::ostream & os, const stealth_vector < T > & vec ) {
os << "[";
bool first = true;
for ( const T & elem : vec ) {
if ( !first ) os << ", ";
first = false;
os << elem;
}
return os << "]";
}
template < class Key, class T, class Compare = std::less < Key > > template < class Key, class T, class Compare = std::less < Key > >
using stealth_map = std::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >; using stealth_map = std::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >;
} }
......
...@@ -162,8 +162,8 @@ public: ...@@ -162,8 +162,8 @@ public:
} }
}; };
   
template< class T > template< class T , class Allocator >
std::ostream& operator<<(std::ostream& out, const std::vector<T>& vector) { std::ostream& operator<<(std::ostream& out, const std::vector<T, Allocator>& vector) {
out << "["; out << "[";
   
bool first = true; bool first = true;
...@@ -192,9 +192,9 @@ std::ostream& operator<<(std::ostream& out, const std::ptr_vector<T>& vector) { ...@@ -192,9 +192,9 @@ std::ostream& operator<<(std::ostream& out, const std::ptr_vector<T>& vector) {
return out; return out;
} }
   
template<class T> template<class T, class Allocator>
struct compare<vector<T>> { struct compare<vector<T, Allocator>> {
int operator()(const vector<T>& first, const vector<T>& second) const { int operator()(const vector<T, Allocator>& first, const vector<T, Allocator>& second) const {
if(first.size() < second.size()) return -1; if(first.size() < second.size()) return -1;
if(first.size() > second.size()) return 1; if(first.size() > second.size()) return 1;
   
......
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