author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 22:16:05 +0300 | |
changeset 59 | 09fa7c3c5079 |
parent 34 | 5fae379060a7 |
child 45 | 4b03adbd26ca |
permissions | -rw-r--r-- |
31 | 1 |
#ifndef ALIGNED_BUFFER_H |
2 |
#define ALIGNED_BUFFER_H |
|
3 |
||
4 |
_STLP_BEGIN_NAMESPACE |
|
5 |
// this is for fake initialization |
|
6 |
template<class T> |
|
7 |
union _Stl_aligned_buffer { |
|
8 |
char buf[sizeof(T)]; |
|
9 |
struct { double a; double b; } padding; |
|
10 |
||
11 |
T* operator&() { |
|
12 |
return __REINTERPRET_CAST(T*, this); |
|
13 |
} |
|
14 |
||
15 |
T const* operator&() const { |
|
16 |
return __REINTERPRET_CAST(T const*, this); |
|
17 |
} |
|
18 |
}; |
|
19 |
_STLP_END_NAMESPACE |
|
20 |
||
21 |
#endif |