clang-format pass

This commit is contained in:
2022-09-18 02:05:46 -04:00
parent 135d63412c
commit 6a979e343f
214 changed files with 2282 additions and 1957 deletions

View File

@@ -34,4 +34,4 @@ private:
};
} // namespace rstl
#endif
#endif

View File

@@ -10,13 +10,15 @@
#include "rstl/vector.hpp"
namespace rstl {
template < typename K, typename P, int unk, typename Select, typename Hash, typename Equal, typename Alloc = rmemory_allocator >
template < typename K, typename P, int unk, typename Select, typename Hash, typename Equal,
typename Alloc = rmemory_allocator >
class hash_table {
private:
rstl::vector< rstl::list< P, Alloc > /*::iterator*/, Alloc > x;
};
template < typename K, typename V, typename Hash, typename Equal, typename Alloc = rmemory_allocator >
template < typename K, typename V, typename Hash, typename Equal,
typename Alloc = rmemory_allocator >
class hash_map {
typedef rstl::pair< K, V > Pair;

View File

@@ -10,7 +10,10 @@ public:
inline pair() {}
inline pair(const L& first, const R& second) : first(first), second(second) {}
inline pair(const pair& other) : first(other.first), second(other.second) {}
inline void operator=(const pair& other) { first = other.first; second = other.second; }
inline void operator=(const pair& other) {
first = other.first;
second = other.second;
}
L first;
R second;

View File

@@ -22,8 +22,14 @@ public:
const_pointer_iterator() : current(nullptr) {}
const_pointer_iterator(const T* begin) : current(begin) {}
const_pointer_iterator& operator++() { ++current; return *this; }
const_pointer_iterator& operator--() { --current; return *this; }
const_pointer_iterator& operator++() {
++current;
return *this;
}
const_pointer_iterator& operator--() {
--current;
return *this;
}
T* get_pointer() const { return const_cast< T* >(current); }
const T& operator*() const { return *get_pointer(); }
const T* operator->() const { return get_pointer(); }
@@ -31,8 +37,12 @@ public:
bool operator==(const const_pointer_iterator& other) { return current == other.current; }
bool operator!=(const const_pointer_iterator& other) { return current != other.current; }
friend const_pointer_iterator operator+(const const_pointer_iterator& x, int v) { return const_pointer_iterator(x.current + v); }
friend const_pointer_iterator operator-(const const_pointer_iterator& x, int v) { return const_pointer_iterator(x.current - v); }
friend const_pointer_iterator operator+(const const_pointer_iterator& x, int v) {
return const_pointer_iterator(x.current + v);
}
friend const_pointer_iterator operator-(const const_pointer_iterator& x, int v) {
return const_pointer_iterator(x.current - v);
}
};
template < typename T, typename Vec, typename Alloc >
@@ -54,11 +64,21 @@ public:
rstl::destroy(get_pointer());
}
}
pointer_iterator& operator++() { ++current; return *this; }
pointer_iterator& operator--() { --current; return *this; }
pointer_iterator& operator++() {
++current;
return *this;
}
pointer_iterator& operator--() {
--current;
return *this;
}
friend pointer_iterator operator+(const pointer_iterator& x, int v) { return pointer_iterator(x.get_pointer() + v); }
friend pointer_iterator operator-(const pointer_iterator& x, int v) { return pointer_iterator(x.get_pointer() - v); }
friend pointer_iterator operator+(const pointer_iterator& x, int v) {
return pointer_iterator(x.get_pointer() + v);
}
friend pointer_iterator operator-(const pointer_iterator& x, int v) {
return pointer_iterator(x.get_pointer() - v);
}
};
} // namespace rstl

View File

@@ -13,4 +13,4 @@ struct less {};
template < typename T, typename P, int U, typename S = select1st< P >, typename Cmp = less< T > >
class red_black_tree {};
}; // namespace rstl
#endif
#endif

View File

@@ -9,7 +9,8 @@ namespace rstl {
template < typename _CharTp >
struct char_traits {};
template < typename _CharTp, typename Traits = char_traits< _CharTp >, typename Alloc = rmemory_allocator >
template < typename _CharTp, typename Traits = char_traits< _CharTp >,
typename Alloc = rmemory_allocator >
class basic_string {
struct COWData {
u32 x0_capacity;