Skip to content

Commit 4f8c43c

Browse files
committed
Don't needlessly use decltype in buffers
1 parent 701a916 commit 4f8c43c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

include/cpp-sort/utility/buffer.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,49 +39,49 @@ namespace cppsort::utility
3939
}
4040

4141
constexpr auto operator[](std::size_t pos)
42-
-> decltype(_memory[pos])
42+
-> typename std::array<T, N>::reference
4343
{
4444
return _memory[pos];
4545
}
4646

4747
constexpr auto operator[](std::size_t pos) const
48-
-> decltype(_memory[pos])
48+
-> typename std::array<T, N>::const_reference
4949
{
5050
return _memory[pos];
5151
}
5252

5353
constexpr auto begin()
54-
-> decltype(_memory.data())
54+
-> T*
5555
{
5656
return _memory.data();
5757
}
5858

5959
constexpr auto begin() const
60-
-> decltype(_memory.data())
60+
-> const T*
6161
{
6262
return _memory.data();
6363
}
6464

6565
constexpr auto cbegin() const
66-
-> decltype(_memory.data())
66+
-> const T*
6767
{
6868
return _memory.data();
6969
}
7070

7171
constexpr auto end()
72-
-> decltype(_memory.data() + _memory.size())
72+
-> T*
7373
{
7474
return _memory.data() + _memory.size();
7575
}
7676

7777
constexpr auto end() const
78-
-> decltype(_memory.data() + _memory.size())
78+
-> const T*
7979
{
8080
return _memory.data() + _memory.size();
8181
}
8282

8383
constexpr auto cend() const
84-
-> decltype(_memory.data() + _memory.size())
84+
-> const T*
8585
{
8686
return _memory.data() + _memory.size();
8787
}
@@ -193,49 +193,49 @@ namespace cppsort::utility
193193
}
194194

195195
auto operator[](std::size_t pos)
196-
-> decltype(_memory[pos])
196+
-> T&
197197
{
198198
return _memory[pos];
199199
}
200200

201201
auto operator[](std::size_t pos) const
202-
-> decltype(_memory[pos])
202+
-> const T&
203203
{
204204
return _memory[pos];
205205
}
206206

207207
auto begin()
208-
-> decltype(_memory.get())
208+
-> T*
209209
{
210210
return _memory.get();
211211
}
212212

213213
auto begin() const
214-
-> decltype(_memory.get())
214+
-> const T*
215215
{
216216
return _memory.get();
217217
}
218218

219219
auto cbegin() const
220-
-> decltype(_memory.get())
220+
-> const T*
221221
{
222222
return _memory.get();
223223
}
224224

225225
auto end()
226-
-> decltype(_memory.get() + size())
226+
-> T*
227227
{
228228
return _memory.get() + size();
229229
}
230230

231231
auto end() const
232-
-> decltype(_memory.get() + size())
232+
-> const T*
233233
{
234234
return _memory.get() + size();
235235
}
236236

237237
auto cend() const
238-
-> decltype(_memory.get() + size())
238+
-> const T*
239239
{
240240
return _memory.get() + size();
241241
}

0 commit comments

Comments
 (0)