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
172c4d9c
Commit
172c4d9c
authored
3 years ago
by
Max Kellermann
Committed by
Max Kellermann
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/BindMethod: remove unnecessary template arguments from BindMethodWrapperGenerator
parent
bd5f6cbc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
BindMethod.hxx
src/util/BindMethod.hxx
+6
-10
No files found.
src/util/BindMethod.hxx
View file @
172c4d9c
...
...
@@ -137,28 +137,25 @@ struct MethodWrapperWithSignature<R(Args...) noexcept(NoExcept)> {
/**
* Generate a wrapper function.
*
* @param T the containing class
* @param method the method pointer
* @param S the plain function signature type
*/
template
<
typename
T
,
auto
method
,
typename
S
>
template
<
typename
M
,
auto
method
>
struct
BindMethodWrapperGenerator
;
template
<
typename
T
,
bool
NoExcept
,
auto
method
,
typename
R
,
typename
...
Args
>
struct
BindMethodWrapperGenerator
<
T
,
method
,
R
(
Args
...)
noexcept
(
NoExcept
)
>
{
struct
BindMethodWrapperGenerator
<
R
(
T
::*
)(
Args
...)
noexcept
(
NoExcept
),
method
>
{
static
R
Invoke
(
void
*
_instance
,
Args
...
args
)
noexcept
(
NoExcept
)
{
auto
&
t
=
*
(
T
*
)
_instance
;
return
(
t
.
*
method
)(
std
::
forward
<
Args
>
(
args
)...);
}
};
template
<
typename
T
,
typename
S
,
typename
MethodWithSignature
<
T
,
S
>::
method_pointer
method
>
typename
MethodWrapperWithSignature
<
S
>::
function_pointer
template
<
auto
method
>
typename
MethodWrapperWithSignature
<
typename
MethodSignatureHelper
<
decltype
(
method
)
>::
plain_signature
>::
function_pointer
MakeBindMethodWrapper
()
noexcept
{
return
BindMethodWrapperGenerator
<
T
,
method
,
S
>::
Invoke
;
return
BindMethodWrapperGenerator
<
decltype
(
method
),
method
>::
Invoke
;
}
/**
...
...
@@ -222,11 +219,10 @@ constexpr auto
BindMethod
(
typename
BindMethodDetail
::
MethodSignatureHelper
<
decltype
(
method
)
>::
class_type
&
instance
)
noexcept
{
using
H
=
BindMethodDetail
::
MethodSignatureHelper
<
decltype
(
method
)
>
;
using
class_type
=
typename
H
::
class_type
;
using
plain_signature
=
typename
H
::
plain_signature
;
return
BoundMethod
<
plain_signature
>
{
&
instance
,
BindMethodDetail
::
MakeBindMethodWrapper
<
class_type
,
plain_signature
,
method
>
(),
BindMethodDetail
::
MakeBindMethodWrapper
<
method
>
(),
};
}
...
...
This diff is collapsed.
Click to expand it.
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