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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Nils-Arne Dreier
dune-common
Commits
122c8a7c
Commit
122c8a7c
authored
9 years ago
by
Ansgar Burchardt
Browse files
Options
Downloads
Patches
Plain Diff
Use alignof(T) instead of Dune::AlignmentOf<T>::value
The alignof() operator was introduced in C++11.
parent
36d834a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/poolallocator.hh
+1
-2
1 addition, 2 deletions
dune/common/poolallocator.hh
dune/common/test/poolallocatortest.cc
+2
-3
2 additions, 3 deletions
dune/common/test/poolallocatortest.cc
with
3 additions
and
5 deletions
dune/common/poolallocator.hh
+
1
−
2
View file @
122c8a7c
...
...
@@ -7,7 +7,6 @@
* \brief An stl-compliant pool allocator
*/
#include
"alignment.hh"
#include
"lcm.hh"
#include
<typeinfo>
#include
<iostream>
...
...
@@ -124,7 +123,7 @@ namespace Dune
* @brief The alignment that suits both the MemberType and
* the Reference (i.e. their least common multiple).
*/
alignment
=
Lcm
<
A
lign
mentOf
<
MemberType
>::
value
,
AlignmentOf
<
Reference
>::
value
>::
value
,
alignment
=
Lcm
<
a
lign
of
(
MemberType
),
alignof
(
Reference
)
>::
value
,
/**
* @brief The aligned size of the type.
...
...
This diff is collapsed.
Click to expand it.
dune/common/test/poolallocatortest.cc
+
2
−
3
View file @
122c8a7c
...
...
@@ -5,7 +5,6 @@
#endif
#include
<dune/common/poolallocator.hh>
#include
<dune/common/alignment.hh>
#include
<dune/common/fmatrix.hh>
using
namespace
Dune
;
...
...
@@ -108,7 +107,7 @@ int testPool()
int
ret
=
0
;
std
::
cout
<<
"Checking "
<<
typeid
(
T
).
name
()
<<
" sizeof="
<<
sizeof
(
T
)
<<
" with size "
<<
size
<<
" alignment="
<<
A
lign
mentOf
<
T
>::
value
<<
std
::
endl
;
" alignment="
<<
a
lign
of
(
T
)
<<
std
::
endl
;
ret
+=
testPoolMain
<
0
,
T
>::
test
();
ret
+=
testPoolMain
<
size
,
T
>::
test
();
...
...
@@ -157,7 +156,7 @@ int main(int, char **)
ret
+=
testPoolAllocator
();
std
::
cout
<<
A
lign
mentOf
<
UnAligned
>::
value
<<
" "
<<
sizeof
(
UnAligned
)
<<
std
::
endl
;
std
::
cout
<<
a
lign
of
(
UnAligned
)
<<
" "
<<
sizeof
(
UnAligned
)
<<
std
::
endl
;
ret
+=
testPool
<
UnAligned
>
();
...
...
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