I had to make the following patch to pyplusplus\code_repository\array_1.py in order to make it compile using Visual-C++ 6.5: Index: array_1.py =================================================================== --- array_1.py (Revision 494) +++ array_1.py (Arbeitskopie) @@ -28,13 +28,14 @@ inline void raise_on_out_of_range( long unsigned int size, long unsigned int index ){ - if( index < 0 || size <= index ){ + if( size <= index ){ throw std::out_of_range("index out of range"); } } template< class TItemType, long unsigned int size > struct const_array_1_t{ + typedef boost::call_traits<const TItemType>::param_type ref; const_array_1_t( TItemType const * const data ) : m_data( data ){ @@ -47,8 +48,7 @@ return size; } - typename boost::call_traits<const TItemType>::param_type - item_ref( long unsigned int index ) const{ + ref item_ref( long unsigned int index ) const{ raise_on_out_of_range( size, index ); return m_data[index]; } @@ -61,6 +61,7 @@ template< class TItemType, long unsigned int size > struct array_1_t{ + typedef boost::call_traits<const TItemType>::param_type ref; array_1_t( TItemType * data ) : m_data( data ){ @@ -73,15 +74,14 @@ return size; } - typename boost::call_traits<const TItemType>::param_type - item_ref( long unsigned int index ) const{ + ref item_ref( long unsigned int index ) const{ raise_on_out_of_range( size, index ); return m_data[index]; } void set_item( long unsigned int index - , typename boost::call_traits<const TItemType>::param_type new_value ){ + , ref new_value ){ raise_on_out_of_range( size, index ); m_data[index] = new_value; } Cheers, Gottfried
On 9/11/06, Ganssauge, Gottfried <Gottfried.Ganssauge@haufe.de> wrote:
I had to make the following patch to pyplusplus\code_repository\array_1.py in order to make it compile using Visual-C++ 6.5:
Thank you. Unfortunately I was not able to apply the patch as is. It breaks the compilation on MSVC 7.1. I reworked the patch a little. I hope it will work on your compiler too. You can find the patch here. http://svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/pyplusplus/code_re... Can you test it? Thanks -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/
-----Original Message----- From: c++-sig-bounces@python.org [mailto:c++-sig-bounces@python.org] On Behalf Of Roman Yakovenko Sent: Monday, September 11, 2006 11:55 AM To: Development of Python/C++ integration Subject: Re: [C++-sig] Patch for py++
On 9/11/06, Ganssauge, Gottfried <Gottfried.Ganssauge@haufe.de> wrote:
I had to make the following patch to pyplusplus\code_repository\array_1.py in order to make it compile using Visual-C++ 6.5:
Thank you. Unfortunately I was not able to apply the patch as is. It breaks the compilation on MSVC 7.1. I reworked the patch a little. I hope it will work on your compiler too. You can find the patch here. http://svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/pypl usplus/code_repository/array_1.py?view=markup
Can you test it? Thanks Works :-)
Cheers, Gottfried
-- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _______________________________________________ C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig
participants (2)
-
Ganssauge, Gottfried -
Roman Yakovenko