0

I have been programming in C++ for a long time and decided to learn deeper C++ language. I read a very good site enter link description here and started reading articles about attributes.

Common syntax attributes give programmers the alignas-specifier with attribute syntax.

How does it work and where I can write attributes with alignas-specifier?

  • No. I told about using alignas in attribute syntax. – Kot Leapold Feb 28 '18 at 20:49
  • 1
    It is difficult to understand what you're asking. After reading the question linked by @Norrius, what exact questions do you have? Do you have a general question about what it does? – Litty Feb 28 '18 at 20:53
  • By link which I added in question you can read. – Kot Leapold Feb 28 '18 at 20:58
  • Text are next: Introduces implementation-defined attributes for types, objects, code, etc. [[attr]] [[attr1, attr2, attr3(args)]] [[namespace::attr(args)]] alignas_specifier – Kot Leapold Feb 28 '18 at 21:00
  • You should use `@username` when replying to people not under their own posts, otherwise they might not get a notification and not reply. – HolyBlackCat Feb 28 '18 at 21:02
  • 1
    So, can you rephrase the question? As Litty said, it's not clear. – HolyBlackCat Feb 28 '18 at 21:05

1 Answers1

1

You seem to think that the page says that you can use alignas inside of [[ ]] as well as outside, but that's not the case.

alignas_specifier is a part of the attribute specifier sequence, although it has different syntax. It may appear where the [[...]] attributes appear and may mix with them (provided it is used where alignas is permitted)

(emphasis mine)

It doesn't say that you can use alignas as an attribute. It says that alignas can appear in same locations as attribute lists.

HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207