Fix issue with ctl::vector constructor

This commit is contained in:
Justine Tunney 2024-06-30 02:26:38 -07:00
parent 4cb5e21ba8
commit 387310c659
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 70 additions and 24 deletions

View file

@ -37,24 +37,28 @@ struct array
constexpr reference at(size_type pos)
{
if (pos >= N)
throw ctl::out_of_range("out of range");
throw ctl::out_of_range();
return elems[pos];
}
constexpr const_reference at(size_type pos) const
{
if (pos >= N)
throw ctl::out_of_range("out of range");
throw ctl::out_of_range();
return elems[pos];
}
constexpr reference operator[](size_type pos)
{
if (pos >= N)
__builtin_trap();
return elems[pos];
}
constexpr const_reference operator[](size_type pos) const
{
if (pos >= N)
__builtin_trap();
return elems[pos];
}