This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]