aligned_buffer.h 398 B

123456789101112131415161718192021
  1. #ifndef ALIGNED_BUFFER_H
  2. #define ALIGNED_BUFFER_H
  3. _STLP_BEGIN_NAMESPACE
  4. // this is for fake initialization
  5. template<class T>
  6. union _Stl_aligned_buffer {
  7. char buf[sizeof(T)];
  8. struct { double a; double b; } padding;
  9. T* operator&() {
  10. return __REINTERPRET_CAST(T*, this);
  11. }
  12. T const* operator&() const {
  13. return __REINTERPRET_CAST(T const*, this);
  14. }
  15. };
  16. _STLP_END_NAMESPACE
  17. #endif