Revision: 865
http://svn.sourceforge.net/pygccxml/?rev=865&view=rev
Author: roman_yakovenko
Date: 2007-01-10 10:31:02 -0800 (Wed, 10 Jan 2007)
Log Message:
-----------
adding pyplusplus::aliases hint
Modified Paths:
--------------
pyplusplus_dev/docs/documentation/hints.rest
Modified: pyplusplus_dev/docs/documentation/hints.rest
===================================================================
--- pyplusplus_dev/docs/documentation/hints.rest 2007-01-10 06:38:42 UTC (rev 864)
+++ pyplusplus_dev/docs/documentation/hints.rest 2007-01-10 18:31:02 UTC (rev 865)
@@ -29,10 +29,34 @@
class_< std::vector< int > >( "numbers" )
...
;
+
+`Py++`_ will pick up the alias, only in case the class has single "typedef".
+
+``pyplusplus::aliases`` namespace
+---------------------------------
+
+The previous approach is "implicit" - `Py++`_ does something behind the scene.
+Recently (version 0.8.6 ), another approach was introduced:
+
+.. code-block:: C++
+
+ #include <vector>
-This feature will work only in case there is only one such ``typedef``. Using class
-property ``aliases`` you can get access to all ``typedef``'s of the class.
+ namespace pyplusplus{ namespace aliases{
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ typedef std::vector< int > numbers;
+
+ } } //pyplusplus::aliases
+The idea is that you create namespace with a special name - ``pyplusplus::aliases``
+and `Py++`_ automatically picks the class aliases from it. In case you accidentally
+introduced two or more different aliases to the same class, it will pick the
+longest one and print a warning. Other advantages of the approach:
+
+* you are not forced to learn new API
+
+* you continue to use your favorite editor and familiar language
+
.. _`Py++` : ./../pyplusplus.html
.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html
.. _`Python`: http://www.python.org
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|