lundi 29 mars 2021

How to do template pack expansion with C++11 attribute-list?

According to [temp.variadic#5.8]:

Pack expansions can occur in the following contexts:

  • In an attribute-list ([dcl.attr.grammar]); the pattern is an attribute.

which means we can do a pack expansion on attribute-list.

But I didn’t find any examples about it, and cppreference only showed a piece of code for it:

void [[attributes...]] function()

Under what circumstances do we want to do this? And how to do this? Can someone give an example?

Aucun commentaire:

Enregistrer un commentaire