From be94b4373a6ab4455a36ffa5bdee0448bb47dbe0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 May 2020 15:44:21 +0200 Subject: [PATCH] util/OffsetPointer: add `noexcept` --- src/util/OffsetPointer.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/OffsetPointer.hxx b/src/util/OffsetPointer.hxx index 383f7271e..217a2ba5d 100644 --- a/src/util/OffsetPointer.hxx +++ b/src/util/OffsetPointer.hxx @@ -35,7 +35,7 @@ * Offset the given pointer by the specified number of bytes. */ constexpr void * -OffsetPointer(void *p, ptrdiff_t offset) +OffsetPointer(void *p, ptrdiff_t offset) noexcept { return (char *)p + offset; } @@ -44,7 +44,7 @@ OffsetPointer(void *p, ptrdiff_t offset) * Offset the given pointer by the specified number of bytes. */ constexpr const void * -OffsetPointer(const void *p, ptrdiff_t offset) +OffsetPointer(const void *p, ptrdiff_t offset) noexcept { return (const char *)p + offset; }