Could you please explain how to get information from attributes in C++? For example, I want to write C++ to python binding. For this I need to annotate all methods in class
An update with some more recent information:
GCC now (as of 4.8) implements C++11 attributes as an alternative syntax for __attribute__((XXX))
.
You can also use the GCC plugin mechanism to define new attributes - see https://gcc.gnu.org/onlinedocs/gccint/Plugins.html.
You can also do this in python using the gcc-python-plugin - see https://gcc-python-plugin.readthedocs.org/en/latest/attributes.html.
Attributes (a new C++11 feature) are just a standardized syntax for compiler extensions. To do what you want you would need a compiler with the proper extensions. So far, I don't think any compiler even implements attribute syntax, much less any specific attributes for Python bindings.
Because they're intended for compiler extensions, there's no standard way of creating your own attributes, like you can with Java annotations or C# attributes. Of course, a compiler could provide this ability as an extension... ;)