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
78a159d0
Commit
78a159d0
authored
2 years ago
by
Robert K
Committed by
Simon Praetorius
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[feature] Added check for detected_or_fallback_t.
parent
0ff46d24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1164
[feature] added a class detected_or_warning_t which checks if a type
Pipeline
#53148
passed
2 years ago
Stage: .pre
Stage: test
Stage: downstream
Pipeline: Dune Nightly Test
#53150
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/test/CMakeLists.txt
+4
-0
4 additions, 0 deletions
dune/common/test/CMakeLists.txt
dune/common/test/stdchecktypes.cc
+52
-0
52 additions, 0 deletions
dune/common/test/stdchecktypes.cc
with
56 additions
and
0 deletions
dune/common/test/CMakeLists.txt
+
4
−
0
View file @
78a159d0
...
...
@@ -327,6 +327,10 @@ dune_add_test(SOURCES stdapplytest.cc
LINK_LIBRARIES dunecommon
LABELS quick
)
dune_add_test
(
SOURCES stdchecktypes.cc
LINK_LIBRARIES dunecommon
LABELS quick
)
dune_add_test
(
SOURCES streamoperatorstest.cc
LABELS quick
)
...
...
This diff is collapsed.
Click to expand it.
dune/common/test/stdchecktypes.cc
0 → 100644
+
52
−
0
View file @
78a159d0
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<tuple>
#include
<utility>
#include
<sstream>
#include
<dune/common/std/type_traits.hh>
struct
A
{
typedef
long
type
;
};
struct
B
{
};
template
<
class
Traits
>
struct
C
{
template
<
class
T
>
using
Fallback
=
int
;
template
<
class
T
>
using
Target
=
typename
T
::
type
;
using
type
=
Dune
::
detected_or_fallback_t
<
Fallback
,
Target
,
Traits
>
;
void
foo
()
{
};
};
int
main
()
{
C
<
A
>
ca
;
ca
.
foo
();
// this should produce a compiler warning
C
<
B
>
cb
;
cb
.
foo
();
}
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