Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
68ad2a7f
Commit
68ad2a7f
authored
4 years ago
by
René Fritze
Committed by
René Fritze
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[type_traits] simplify is_smart_ptr
parent
ef51196f
No related branches found
No related tags found
1 merge request
!31
Sfinae and stuff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/xt/common/type_traits.hh
+4
-23
4 additions, 23 deletions
dune/xt/common/type_traits.hh
with
4 additions
and
23 deletions
dune/xt/common/type_traits.hh
+
4
−
23
View file @
68ad2a7f
...
...
@@ -250,31 +250,12 @@ std::string get_template_basename(const T&)
return
str
.
substr
(
0
,
r
);
}
template
<
class
T
,
class
Ptr
=
void
>
struct
is_smart_ptr
{
static
const
bool
value
=
false
;
typedef
T
type
;
};
template
<
class
T
>
struct
is_smart_ptr
<
T
,
typename
std
::
enable_if
<
std
::
is_same
<
std
::
unique_ptr
<
typename
T
::
element_type
>
,
T
>::
value
>::
type
>
{
static
const
bool
value
=
true
;
typedef
T
type
;
};
template
<
class
T
>
struct
is_smart_ptr
<
T
,
typename
std
::
enable_if
<
std
::
is_same
<
std
::
shared_ptr
<
typename
T
::
element_type
>
,
T
>::
value
>::
type
>
{
static
const
bool
value
=
true
;
typedef
T
type
;
};
template
<
class
T
>
struct
is_smart_ptr
<
T
,
typename
std
::
enable_if
<
std
::
is_same
<
std
::
weak_ptr
<
typename
T
::
element_type
>
,
T
>::
value
>::
type
>
struct
is_smart_ptr
{
static
const
bool
value
=
true
;
static
const
bool
value
=
std
::
is_same
<
std
::
unique_ptr
<
typename
T
::
element_type
>
,
T
>::
value
||
std
::
is_same
<
std
::
shared_ptr
<
typename
T
::
element_type
>
,
T
>::
value
||
std
::
is_same
<
std
::
weak_ptr
<
typename
T
::
element_type
>
,
T
>::
value
;
typedef
T
type
;
};
...
...
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