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
d59c9031
Commit
d59c9031
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Implemented return type chooser for getRealImplementation.
THis fixes Flyspray bug #118. [[Imported from SVN: r4409]]
parent
657b81e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/common/grid.hh
+20
-6
20 additions, 6 deletions
grid/common/grid.hh
with
20 additions
and
6 deletions
grid/common/grid.hh
+
20
−
6
View file @
d59c9031
...
...
@@ -1200,15 +1200,29 @@ namespace Dune {
{}
protected
:
//! return real implementation of interface class
template
<
class
InterfaceType
>
typename
InterfaceType
::
ImplementationType
&
getRealImplementation
(
InterfaceType
&
i
)
const
{
return
i
.
getRealImp
();
}
/**
* @brief Helper class to choose correct implemetation return type for getRealImplementation
*
* If the template parameter is const, const typename T::ImplementationType is returned otherwise
* just typename ::ImplementationType.
*/
template
<
class
T
>
struct
ReturnImplementationType
{
/** @brief The correct type of the implementation to return. */
typedef
typename
T
::
ImplementationType
ImplementationType
;
};
template
<
class
T
>
struct
ReturnImplementationType
<
const
T
>
{
typedef
const
typename
T
::
ImplementationType
ImplementationType
;
};
//! return real implementation of interface class
template
<
class
InterfaceType
>
const
typename
InterfaceType
::
ImplementationType
&
getRealImplementation
(
const
InterfaceType
&
i
)
const
{
return
i
.
getRealImp
();
}
typename
ReturnImplementationType
<
InterfaceType
>
::
ImplementationType
&
getRealImplementation
(
InterfaceType
&
i
)
const
{
return
i
.
getRealImp
();
}
protected
:
//! Barton-Nackman trick
...
...
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