Skip to content
Snippets Groups Projects
Commit 122c8a7c authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Use alignof(T) instead of Dune::AlignmentOf<T>::value

The alignof() operator was introduced in C++11.
parent 36d834a0
No related branches found
No related tags found
No related merge requests found
......@@ -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<AlignmentOf<MemberType>::value,AlignmentOf<Reference>::value>::value,
alignment = Lcm<alignof(MemberType), alignof(Reference)>::value,
/**
* @brief The aligned size of the type.
......
......@@ -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="<<AlignmentOf<T>::value<<std::endl;
" alignment="<< alignof(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<<AlignmentOf<UnAligned>::value<<" "<<sizeof(UnAligned)<<std::endl;
std::cout<< alignof(UnAligned) <<" "<<sizeof(UnAligned)<<std::endl;
ret += testPool<UnAligned>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment