diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2012-05-18 08:59:28 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2012-05-18 08:59:28 +0200 |
| commit | 1cf398c94c1957961a7a4b8fd59f43e554016bf7 (patch) | |
| tree | ec675e74854ceb8006fca01c8a03d212b18210de /src/mt | |
| parent | 69d3c53462d8c74de3b0eccfee11a9eb60ca26ca (diff) | |
Fix compilation on gcc 4.7
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/mt')
| -rw-r--r-- | src/mt/mvec.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mt/mvec.h b/src/mt/mvec.h index 9f31c1e..412f3d7 100644 --- a/src/mt/mvec.h +++ b/src/mt/mvec.h | |||
| @@ -78,16 +78,16 @@ public: | |||
| 78 | int pos=it-map; ins(pos+1,-1); return map+pos; | 78 | int pos=it-map; ins(pos+1,-1); return map+pos; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void push_back(const T& s) { reserve(dim+1); map[dim++]=s; } | ||
| 82 | void pop_back(const T& s) { if(dim) --dim; } | ||
| 83 | |||
| 84 | //////////////////////////////////////////////////////////////// | 81 | //////////////////////////////////////////////////////////////// |
| 85 | 82 | ||
| 86 | void reserve(int n) { | 83 | void reserve(int n) { |
| 87 | if(caps<n) { while(caps<n) caps<<=1; map=(T*)realloc(map,caps*sizeof(T)); } | 84 | if(caps<n) { while(caps<n) caps<<=1; map=(T*)realloc(map,caps*sizeof(T)); } |
| 88 | } | 85 | } |
| 89 | void resize(int n) { reserve(n); dim=n; } | 86 | void resize(int n) { reserve(n); dim=n; } |
| 90 | 87 | ||
| 88 | void push_back(const T& s) { reserve(dim+1); map[dim++]=s; } | ||
| 89 | void pop_back(const T& s) { if(dim) --dim; } | ||
| 90 | |||
| 91 | //////////////////////////////////////////////////////////////// | 91 | //////////////////////////////////////////////////////////////// |
| 92 | 92 | ||
| 93 | protected: | 93 | protected: |
| @@ -130,7 +130,7 @@ public: | |||
| 130 | it->~T(); int pos=it-map; mrvec<T>::ins(pos+1,-1); return map+pos; | 130 | it->~T(); int pos=it-map; mrvec<T>::ins(pos+1,-1); return map+pos; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | void push_back(const T& s) { reserve(dim+1); new(map+dim++) T(s); } | 133 | void push_back(const T& s) { mrvec<T>::reserve(dim+1); new(map+dim++) T(s); } |
| 134 | void pop_back(const T& s) { if(dim) map[--dim].~T(); } | 134 | void pop_back(const T& s) { if(dim) map[--dim].~T(); } |
| 135 | 135 | ||
| 136 | //////////////////////////////////////////////////////////////// | 136 | //////////////////////////////////////////////////////////////// |
