From 0122dc845218a99231f3fd21f1f124bf9f91144d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Apr 2021 19:57:02 +0200 Subject: [PATCH] util/BindMethod: drop support for GCC older than 7 --- src/util/BindMethod.hxx | 82 +++++++---------------------------------- 1 file changed, 13 insertions(+), 69 deletions(-) diff --git a/src/util/BindMethod.hxx b/src/util/BindMethod.hxx index a257deba3..08d02f98a 100644 --- a/src/util/BindMethod.hxx +++ b/src/util/BindMethod.hxx @@ -30,8 +30,6 @@ #ifndef BIND_METHOD_HXX #define BIND_METHOD_HXX -#include "Compiler.h" - #include #include @@ -45,21 +43,11 @@ template class BoundMethod; -#if GCC_OLDER_THAN(7,0) -static constexpr bool NoExcept = false; -#endif - template class BoundMethod { - typedef R (*function_pointer)(void *instance, Args... args) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; + typedef R (*function_pointer)(void *instance, Args... args) noexcept(NoExcept); void *instance_; function_pointer function; @@ -106,20 +94,10 @@ template struct MethodWithSignature; template -struct MethodWithSignature { - typedef R (T::*method_pointer)(Args...) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; +struct MethodWithSignature { + typedef R (T::*method_pointer)(Args...) noexcept(NoExcept); }; /** @@ -130,11 +108,7 @@ struct MethodWithSignature struct MethodSignatureHelper; -template +template struct MethodSignatureHelper { /** * The class which contains the given method (signature). @@ -145,11 +119,7 @@ struct MethodSignatureHelper { * A function type which describes the "plain" function * signature. */ - typedef R plain_signature(Args...) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; + typedef R plain_signature(Args...) noexcept(NoExcept); }; /** @@ -159,17 +129,10 @@ struct MethodSignatureHelper { template struct MethodWrapperWithSignature; -template +template struct MethodWrapperWithSignature { - typedef R (*function_pointer)(void *instance, Args...) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; + typedef R (*function_pointer)(void *instance, + Args...) noexcept(NoExcept); }; /** @@ -201,10 +164,7 @@ struct BindMethodWrapperGenerator2 { template struct BindMethodWrapperGenerator; -template struct BindMethodWrapperGenerator : BindMethodWrapperGenerator2 { @@ -226,31 +186,19 @@ MakeBindMethodWrapper() noexcept template struct FunctionTraits; -template +template struct FunctionTraits { /** * A function type which describes the "plain" function * signature. */ - typedef R function_type(Args...) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; + typedef R function_type(Args...) noexcept(NoExcept); /** * A function pointer type which describes the "plain" * function signature. */ - typedef R (*pointer)(Args...) -#if !GCC_OLDER_THAN(7,0) - noexcept(NoExcept) -#endif - ; + typedef R (*pointer)(Args...) noexcept(NoExcept); }; /** @@ -280,11 +228,7 @@ struct BindFunctionWrapperGenerator2 { template struct BindFunctionWrapperGenerator; -template +template struct BindFunctionWrapperGenerator : BindFunctionWrapperGenerator2 { };