util/BindMethod: use `using` instead of `typedef`

This commit is contained in:
Max Kellermann 2023-10-02 21:23:45 +02:00 committed by Max Kellermann
parent 19f9238ef0
commit 5dda4084df
1 changed files with 6 additions and 8 deletions

View File

@ -20,7 +20,7 @@ template<typename R,
bool NoExcept, bool NoExcept,
typename... Args> typename... Args>
class BoundMethod<R(Args...) noexcept(NoExcept)> { class BoundMethod<R(Args...) noexcept(NoExcept)> {
typedef R (*function_pointer)(void *instance, Args... args) noexcept(NoExcept); using function_pointer = R (*)(void *, Args...) noexcept(NoExcept);
void *instance_; void *instance_;
function_pointer function; function_pointer function;
@ -68,24 +68,22 @@ struct SignatureHelper<R (T::*)(Args...) noexcept(NoExcept)> {
/** /**
* The class which contains the given method (signature). * The class which contains the given method (signature).
*/ */
typedef T class_type; using class_type = T;
/** /**
* A function type which describes the "plain" function * A function type which describes the "plain" function
* signature. * signature.
*/ */
typedef R plain_signature(Args...) noexcept(NoExcept); using plain_signature = R (Args...) noexcept(NoExcept);
typedef R (*function_pointer)(void *instance, using function_pointer = R (*)(void *, Args...) noexcept(NoExcept);
Args...) noexcept(NoExcept);
}; };
template<typename R, bool NoExcept, typename... Args> template<typename R, bool NoExcept, typename... Args>
struct SignatureHelper<R (*)(Args...) noexcept(NoExcept)> { struct SignatureHelper<R (*)(Args...) noexcept(NoExcept)> {
typedef R plain_signature(Args...) noexcept(NoExcept); using plain_signature = R (Args...) noexcept(NoExcept);
typedef R (*function_pointer)(void *instance, using function_pointer = R (*)(void *, Args...) noexcept(NoExcept);
Args...) noexcept(NoExcept);
}; };
/** /**