| 1 |
/* { dg-do compile } */ |
| 2 |
|
| 3 |
namespace std __attribute__ ((__visibility__ ("default"))) { |
| 4 |
template<typename _Tp> class new_allocator { }; |
| 5 |
template<typename _Tp> class allocator: public new_allocator<_Tp> { }; |
| 6 |
template<typename _Tp, typename _Alloc> struct _Vector_base { }; |
| 7 |
template<typename _Tp, typename _Alloc = std::allocator<_Tp> > |
| 8 |
class vector : protected _Vector_base<_Tp, _Alloc> { }; |
| 9 |
}; |
| 10 |
template<int Dim> class Vector { }; |
| 11 |
enum CenteringType { VertexType, EdgeType, FaceType, CellType }; |
| 12 |
enum ContinuityType { XDim = 1, YDim = XDim << 1, ZDim = YDim << 1 }; |
| 13 |
template <int Dim> class Centering { |
| 14 |
public: |
| 15 |
typedef Vector<Dim> Position; |
| 16 |
typedef std::vector<Position> Positions; |
| 17 |
Centering(const Positions &positions); |
| 18 |
Positions positions_m; |
| 19 |
}; |
| 20 |
template <int Dim> class CanonicalCentering { |
| 21 |
CanonicalCentering(); |
| 22 |
template <class T> static T combine(const T &op1, const T &op2); |
| 23 |
static Centering<Dim>*** centering_table_m; |
| 24 |
}; |
| 25 |
template <int Dim> CanonicalCentering<Dim>::CanonicalCentering() |
| 26 |
{ |
| 27 |
typename Centering<Dim>::Positions positions[Dim][2]; |
| 28 |
enum { x = 0, y, z }; |
| 29 |
int cont = 0; |
| 30 |
if (Dim > 1) |
| 31 |
{ |
| 32 |
centering_table_m[EdgeType][cont][YDim] = Centering<Dim>(positions[y][cont]); |
| 33 |
centering_table_m[EdgeType][cont][XDim|YDim] = Centering<Dim>(combine(positions[x][cont], positions[y][cont])); |
| 34 |
} |
| 35 |
if (Dim > 2) |
| 36 |
{ |
| 37 |
centering_table_m[EdgeType][cont][ZDim] = Centering<Dim>(positions[z][cont]); |
| 38 |
centering_table_m[EdgeType][cont][XDim|ZDim] = Centering<Dim>(combine(positions[x][cont], positions[z][cont])); |
| 39 |
} |
| 40 |
} |
| 41 |
template class CanonicalCentering<2>; |