jeudi 1 février 2018

Is there a difference between `__attribute__((some_attribute))` and `[[some_attribute]]`?

I just came across attributes enclosed in square brackets for the first time, and I've been doing a little background reading: http://en.cppreference.com/w/cpp/language/attributes.

For gcc at least, there seem to be multiple techniques allowed:

__attribute__((some_attribute))

and

[[some_attribute]]

Is this correct? When is one technique allowed or not allowed, preferred or not preferred? What's the difference?

It looks like [[some_attribute]] is allowed as of C++11 only, right?

Aucun commentaire:

Enregistrer un commentaire