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
526f8970
Commit
526f8970
authored
9 years ago
by
Felix Gruber
Committed by
Christoph Grüninger
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[cleanup] replace remove_pointer with std:: implementation
parent
b77df070
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/test/typetraitstest.cc
+0
-7
0 additions, 7 deletions
dune/common/test/typetraitstest.cc
dune/common/typetraits.hh
+1
-14
1 addition, 14 deletions
dune/common/typetraits.hh
with
1 addition
and
21 deletions
dune/common/test/typetraitstest.cc
+
0
−
7
View file @
526f8970
...
...
@@ -26,12 +26,5 @@ int main() {
assert
(
Dune
::
is_lvalue_reference
<
int
&>::
value
);
assert
(
not
Dune
::
is_lvalue_reference
<
int
&&>::
value
);
// Test remove_pointer
assert
(
(
Dune
::
is_same
<
int
,
Dune
::
remove_pointer
<
int
>::
type
>::
value
)
);
assert
(
(
Dune
::
is_same
<
int
,
Dune
::
remove_pointer
<
int
*>::
type
>::
value
)
);
assert
(
(
Dune
::
is_same
<
int
*
,
Dune
::
remove_pointer
<
int
**>::
type
>::
value
)
);
assert
(
(
Dune
::
is_same
<
const
int
,
Dune
::
remove_pointer
<
const
int
*>::
type
>::
value
)
);
assert
(
(
Dune
::
is_same
<
int
,
Dune
::
remove_pointer
<
int
*
const
>::
type
>::
value
)
);
return
0
;
}
This diff is collapsed.
Click to expand it.
dune/common/typetraits.hh
+
1
−
14
View file @
526f8970
...
...
@@ -209,20 +209,7 @@ namespace Dune
:
public
integral_constant
<
bool
,
(
__is_lvalue_reference_helper
<
T
>::
value
)
>
{
};
template
<
typename
_Tp
>
struct
__remove_pointer_helper
{
typedef
_Tp
type
;
};
template
<
typename
_Tp
>
struct
__remove_pointer_helper
<
_Tp
*>
{
typedef
_Tp
type
;
};
/** \brief Return the type a pointer type points to
*/
template
<
typename
_Tp
>
struct
remove_pointer
:
public
__remove_pointer_helper
<
typename
remove_const
<
_Tp
>::
type
>
{
};
using
std
::
remove_pointer
;
/**
\brief template which always yields a false value
...
...
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