Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
SuperElastix
Commits
f5fb31c3
Commit
f5fb31c3
authored
Nov 23, 2015
by
Floris Berendsen
Browse files
ENH: removed static_cast<>; casting can be done implicitly
parent
203f9089
Changes
1
Hide whitespace changes
Inline
Side-by-side
Modules/Core/ComponentInterface/include/Interfaces.hxx
View file @
f5fb31c3
...
...
@@ -36,8 +36,8 @@ interfaceStatus Accepting<FirstInterface, RestInterfaces... >::ConnectFromImpl(c
// does our component have an accepting interface called interfacename?
if
(
0
==
std
::
strcmp
(
InterfaceName
<
InterfaceAcceptor
<
FirstInterface
>>::
Get
(),
interfacename
))
{
//
static_
cast always succeeds since we know via the template arguments of the component which InterfaceAcceptors its base classes are.
InterfaceAcceptor
<
FirstInterface
>*
acceptIF
=
static_cast
<
InterfaceAcceptor
<
FirstInterface
>*>
(
this
)
;
// cast always succeeds since we know via the template arguments of the component which InterfaceAcceptors its base classes are.
InterfaceAcceptor
<
FirstInterface
>*
acceptIF
=
this
;
// See if the other component has the right interface and try to connect them
if
(
1
==
acceptIF
->
Connect
(
other
))
...
...
@@ -57,8 +57,8 @@ interfaceStatus Accepting<FirstInterface, RestInterfaces... >::ConnectFromImpl(c
template
<
typename
FirstInterface
,
typename
...
RestInterfaces
>
int
Accepting
<
FirstInterface
,
RestInterfaces
...
>::
ConnectFromImpl
(
ComponentBase
*
other
)
{
//
static_
cast always succeeds since we know via the template arguments of the component which InterfaceAcceptors its base classes are.
InterfaceAcceptor
<
FirstInterface
>*
acceptIF
=
static_cast
<
InterfaceAcceptor
<
FirstInterface
>*>
(
this
);
// cast always succeeds since we know via the template arguments of the component which InterfaceAcceptors its base classes are.
InterfaceAcceptor
<
FirstInterface
>*
acceptIF
=
(
this
);
// See if the other component has the right interface and try to connect them
// count the number of successes
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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