mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
sprout/random/unique_seed.hpp 更新
at() メンバ関数を constexpr に変更
This commit is contained in:
parent
72d16afcdc
commit
9823888049
6 changed files with 55 additions and 27 deletions
|
@ -157,12 +157,16 @@ namespace sprout {
|
|||
return elems[i];
|
||||
}
|
||||
reference at(size_type i) {
|
||||
rangecheck(i);
|
||||
return elems[i];
|
||||
return i < size()
|
||||
? elems[i]
|
||||
: (throw std::out_of_range("uuid: index out of range"), elems[i])
|
||||
;
|
||||
}
|
||||
const_reference at(size_type i) const {
|
||||
rangecheck(i);
|
||||
return elems[i];
|
||||
SPROUT_CONSTEXPR const_reference at(size_type i) const {
|
||||
return i < size()
|
||||
? elems[i]
|
||||
: (throw std::out_of_range("uuid: index out of range"), elems[i])
|
||||
;
|
||||
}
|
||||
reference front() {
|
||||
return elems[0];
|
||||
|
@ -193,7 +197,7 @@ namespace sprout {
|
|||
}
|
||||
void rangecheck(size_type i) const {
|
||||
if (i >= size()) {
|
||||
throw std::out_of_range("uuid<>: index out of range");
|
||||
throw std::out_of_range("uuid: index out of range");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue