Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
eca097db
Commit
eca097db
authored
Dec 02, 2021
by
Max Kellermann
Committed by
Max Kellermann
Dec 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/BindMethod: simplify more templates using "auto" template arguments
parent
51ffafa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
BindMethod.hxx
src/util/BindMethod.hxx
+6
-8
No files found.
src/util/BindMethod.hxx
View file @
eca097db
...
...
@@ -139,12 +139,11 @@ struct MethodWrapperWithSignature<R(Args...) noexcept(NoExcept)> {
* #BindMethodWrapperGenerator.
*
* @param T the containing class
* @param M the method pointer type
* @param method the method pointer
* @param R the return type
* @param Args the method arguments
*/
template
<
typename
T
,
bool
NoExcept
,
typename
M
,
M
method
,
typename
R
,
typename
...
Args
>
template
<
typename
T
,
bool
NoExcept
,
auto
method
,
typename
R
,
typename
...
Args
>
struct
BindMethodWrapperGenerator2
{
static
R
Invoke
(
void
*
_instance
,
Args
...
args
)
noexcept
(
NoExcept
)
{
auto
&
t
=
*
(
T
*
)
_instance
;
...
...
@@ -156,17 +155,16 @@ struct BindMethodWrapperGenerator2 {
* Generate a wrapper function.
*
* @param T the containing class
* @param M the method pointer type
* @param method the method pointer
* @param S the plain function signature type
*/
template
<
typename
T
,
typename
M
,
M
method
,
typename
S
>
template
<
typename
T
,
auto
method
,
typename
S
>
struct
BindMethodWrapperGenerator
;
template
<
typename
T
,
bool
NoExcept
,
typename
M
,
M
method
,
typename
R
,
typename
...
Args
>
struct
BindMethodWrapperGenerator
<
T
,
M
,
method
,
R
(
Args
...)
noexcept
(
NoExcept
)
>
:
BindMethodWrapperGenerator2
<
T
,
NoExcept
,
M
,
method
,
R
,
Args
...
>
{
auto
method
,
typename
R
,
typename
...
Args
>
struct
BindMethodWrapperGenerator
<
T
,
method
,
R
(
Args
...)
noexcept
(
NoExcept
)
>
:
BindMethodWrapperGenerator2
<
T
,
NoExcept
,
method
,
R
,
Args
...
>
{
};
template
<
typename
T
,
typename
S
,
...
...
@@ -174,7 +172,7 @@ template<typename T, typename S,
typename
MethodWrapperWithSignature
<
S
>::
function_pointer
MakeBindMethodWrapper
()
noexcept
{
return
BindMethodWrapperGenerator
<
T
,
typename
MethodWithSignature
<
T
,
S
>::
method_pointer
,
method
,
S
>::
Invoke
;
return
BindMethodWrapperGenerator
<
T
,
method
,
S
>::
Invoke
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment