util/OffsetPointer: add `noexcept`

This commit is contained in:
Max Kellermann 2020-05-14 15:44:21 +02:00
parent eeec0ee804
commit be94b4373a
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@
* Offset the given pointer by the specified number of bytes. * Offset the given pointer by the specified number of bytes.
*/ */
constexpr void * constexpr void *
OffsetPointer(void *p, ptrdiff_t offset) OffsetPointer(void *p, ptrdiff_t offset) noexcept
{ {
return (char *)p + offset; return (char *)p + offset;
} }
@ -44,7 +44,7 @@ OffsetPointer(void *p, ptrdiff_t offset)
* Offset the given pointer by the specified number of bytes. * Offset the given pointer by the specified number of bytes.
*/ */
constexpr const void * constexpr const void *
OffsetPointer(const void *p, ptrdiff_t offset) OffsetPointer(const void *p, ptrdiff_t offset) noexcept
{ {
return (const char *)p + offset; return (const char *)p + offset;
} }