[libstdc++ PATCH/RFC] Aggressive space optimization for std::vector

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Jul 29 04:53:00 GMT 2003


Doug Gregor <dgregor@apple.com> writes:
| > Also, I suppose this
| >
| > !
| > !   // Primary template has maximum alignment
| > !   template<std::size_t _Alignment>
| > !     struct _Type_with_alignment
| > !     { struct __attribute__((__aligned__)) _M_type {}; };
| > !
| > ! #define _GLIBCXX_TYPE_WITH_ALIGNMENT(_Align)				\
| > !   template<>								\
| > !     struct _Type_with_alignment<_Align> \
| > !     { struct __attribute__((__aligned__(_Align))) _M_type {}; }
| >
| > is for getting around the bug in how attributes are handled (I filled
| > a bug report on that a while ago), i.e. attributes don't respect usual
| > name lookup rules.  Please add a note to that effect.
| 
| I'd really like:
|    template<std::size_t _Alignment>
|      struct __attribute__((__aligned(_Alignment)))
| _Type_with_alignment {};

Me too.  But the way attribute semantics is defined says otherwise.  Will
raise this issue in a separate thread.

-- Gaby



More information about the Libstdc++ mailing list