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
7721fbc7
Commit
7721fbc7
authored
2 years ago
by
Simon Praetorius
Browse files
Options
Downloads
Patches
Plain Diff
Deprecate the DUNE_ASSERT_AND_RETURN macro
parent
4eee0b3a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1236
Deprecate the DUNE_ASSERT_AND_RETURN macro
Pipeline
#60659
passed
2 years ago
Stage: .pre
Stage: test
Stage: downstream
Pipeline: Dune Nightly Test
#60661
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-1
2 additions, 1 deletion
CHANGELOG.md
dune/common/assertandreturn.hh
+5
-0
5 additions, 0 deletions
dune/common/assertandreturn.hh
dune/common/hybridutilities.hh
+2
-5
2 additions, 5 deletions
dune/common/hybridutilities.hh
with
9 additions
and
6 deletions
CHANGELOG.md
+
2
−
1
View file @
7721fbc7
...
...
@@ -70,7 +70,8 @@ In order to build the DUNE core modules you need at least the following software
-
Deprecated
`conjunction`
,
`disjunction`
, and
`negation`
have been removed. Instead,
use the structs from
`<type_traits>`
introduced with C++17.
-
Remove deprecated
`dune/common/std/apply.hh`
, use
`std::apply`
instead.
-
Deprecated the file
`dune/common/assertandreturn.hh`
and the contained utility
`DUNE_ASSERT_AND_RETURN`
. Use
`assert()`
macro directly in
`constexpr`
functions.
# Release 2.9
...
...
This diff is collapsed.
Click to expand it.
dune/common/assertandreturn.hh
+
5
−
0
View file @
7721fbc7
...
...
@@ -5,6 +5,10 @@
#ifndef DUNE_COMMON_ASSERTANDRETURN_HH
#define DUNE_COMMON_ASSERTANDRETURN_HH
#warning "The file assertandreturn.hh is deprecated. Since c++14 constexpr functions allow more \
than a single return statement and thus this utility is useless. Will be removed after \
Dune 2.10 release."
#include
<cassert>
//! Asserts a condition and return on success in constexpr context.
...
...
@@ -15,6 +19,7 @@
* and then returns the value of the second argument.
*
* \ingroup CxxUtilities
* \deprecated Will be removed after Dune 2.10 release
*/
#ifdef NDEBUG
#define DUNE_ASSERT_AND_RETURN(C,X) X
...
...
This diff is collapsed.
Click to expand it.
dune/common/hybridutilities.hh
+
2
−
5
View file @
7721fbc7
...
...
@@ -149,14 +149,11 @@ namespace Impl {
return
Dune
::
StaticIntegralRange
<
std
::
size_t
,
End
::
value
,
Begin
::
value
>
();
}
// This should be constexpr but gcc-4.9 does not support
// the relaxed constexpr requirements. Hence for being
// constexpr the function body can only contain a return
// statement and no assertion before this.
template
<
class
Begin
,
class
End
>
constexpr
auto
integralRange
(
const
Begin
&
begin
,
const
End
&
end
,
const
PriorityTag
<
0
>&
)
{
return
DUNE_ASSERT_AND_RETURN
(
begin
<=
end
,
Dune
::
IntegralRange
<
End
>
(
begin
,
end
));
assert
(
begin
<=
end
&&
"You cannot create an integralRange where end<begin"
);
return
Dune
::
IntegralRange
<
End
>
(
begin
,
end
);
}
}
// namespace Impl
...
...
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