add comment about macro issues (fixes #203)

This commit is contained in:
Wenzel Jakob 2016-05-21 10:48:30 +02:00
parent 02096a057f
commit bd986fe57e

View File

@ -313,6 +313,15 @@ a virtual method call.
>>> call_go(c) >>> call_go(c)
u'meow! meow! meow! ' u'meow! meow! meow! '
.. warning::
Both :func:`PYBIND11_OVERLOAD` and :func:`PYBIND11_OVERLOAD_PURE` are
macros, which means that they can get confused by commas in a template
argument such as ``PYBIND11_OVERLOAD(MyReturnValue<T1, T2>, myFunc)``. In
this case, the preprocessor assumes that the comma indicates the beginnning
of the next parameter. Use a ``typedef`` to bind the template to another
name and use it in the macro to avoid this problem.
.. seealso:: .. seealso::
The file :file:`example/example12.cpp` contains a complete example that The file :file:`example/example12.cpp` contains a complete example that