Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
7f05ac24
Commit
7f05ac24
authored
15 years ago
by
Jorrit Fahlke
Browse files
Options
Downloads
Patches
Plain Diff
replace dynamic if's by the proper static ones
[[Imported from SVN: r5674]]
parent
45223263
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/iteratorfacades.hh
+24
-14
24 additions, 14 deletions
dune/common/iteratorfacades.hh
with
24 additions
and
14 deletions
dune/common/iteratorfacades.hh
+
24
−
14
View file @
7f05ac24
...
...
@@ -363,23 +363,36 @@ namespace Dune
/**
* @brief Checks for equality.
*
* This operation is only defined if either D2
* is convertible to D1 or vice versa. If that is
* not the case the compiler will report an error
* as EnableIfInterOperable<D1,D2,bool>::type is
* not defined.
* This operation is only defined if T2 is convertible to T1, otherwise it
* is removed from the overload set since the enable_if for the return type
* yield an invalid type expression.
*/
template
<
class
T1
,
class
V1
,
class
R1
,
class
D
,
class
T2
,
class
V2
,
class
R2
>
inline
typename
enable_if
<
Conversion
<
T2
,
T1
>::
exists
,
bool
>::
type
operator
==
(
const
BidirectionalIteratorFacade
<
T1
,
V1
,
R1
,
D
>&
lhs
,
const
BidirectionalIteratorFacade
<
T2
,
V2
,
R2
,
D
>&
rhs
)
{
return
static_cast
<
const
T1
&>
(
lhs
).
equals
(
static_cast
<
const
T2
&>
(
rhs
));
}
/**
* @brief Checks for equality.
*
* This operation is only defined if either T1 is convertible to T2, and T2
* is not convetible to T1. Otherwise the operator is removed from the
* overload set since the enable_if for the return type yield an invalid
* type expression.
*/
template
<
class
T1
,
class
V1
,
class
R1
,
class
D
,
class
T2
,
class
V2
,
class
R2
>
inline
typename
EnableIfInterOperable
<
T1
,
T2
,
bool
>::
type
inline
typename
enable_if
<
Conversion
<
T1
,
T2
>::
exists
&&
!
Conversion
<
T2
,
T1
>::
exists
,
bool
>::
type
operator
==
(
const
BidirectionalIteratorFacade
<
T1
,
V1
,
R1
,
D
>&
lhs
,
const
BidirectionalIteratorFacade
<
T2
,
V2
,
R2
,
D
>&
rhs
)
{
if
(
Conversion
<
T2
,
T1
>::
exists
)
return
static_cast
<
const
T1
&>
(
lhs
).
equals
(
static_cast
<
const
T2
&>
(
rhs
));
else
return
static_cast
<
const
T2
&>
(
rhs
).
equals
(
static_cast
<
const
T1
&>
(
lhs
));
return
static_cast
<
const
T2
&>
(
rhs
).
equals
(
static_cast
<
const
T1
&>
(
lhs
));
}
/**
...
...
@@ -398,10 +411,7 @@ namespace Dune
operator
!=
(
const
BidirectionalIteratorFacade
<
T1
,
V1
,
R1
,
D
>&
lhs
,
const
BidirectionalIteratorFacade
<
T2
,
V2
,
R2
,
D
>&
rhs
)
{
if
(
Conversion
<
T2
,
T1
>::
exists
)
return
!
static_cast
<
const
T1
&>
(
lhs
).
equals
(
static_cast
<
const
T2
&>
(
rhs
));
else
return
!
static_cast
<
const
T2
&>
(
rhs
).
equals
(
static_cast
<
const
T1
&>
(
lhs
));
return
!
(
lhs
==
rhs
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment