So this is now fixed in Cython, just get the most recent master from
github. :-)
Sturla


Sturla Molden <sturla.mol...@gmail.com>
wrote:
> On 16/02/14 18:36, Sturla Molden wrote:
>> On 16/02/14 17:59, Sturla Molden wrote:
>>   > Eh, I am not even sure it should be legal to call an iterator like this:
>>   >
>>   >      typedef __pyx_t_7sklearn_5utils_9fast_dict_ITYPE_t ITYPE;
>>   >      typedef __pyx_t_7sklearn_5utils_9fast_dict_DTYPE_t DTYPE;
>>   >
>>   >      p->__pyx_v_it.std::map<ITYPE,DTYPE>::iterator::~iterator();
>>   >
>>   > (I typedef'ed the Cython generated template types for clarity here.)
>>   >
>>   > Destructors in C++ should be called by calling delete, like so:
>>   >
>>   >      delete p->__pyx_v_it;
>>   >
>>   > It seems Cython is not generating normal C++. I don't know why.
>> 
>> 
>> 
>> Actually, it is a bug in the Cython generated C++. clang++ is doing the
>> right thing here. And all compilers allowing this code are wrong.
>> 
>> https://bugzilla.mozilla.org/show_bug.cgi?id=623303
>> 
>> https://mail.python.org/pipermail/cython-devel/2013-April/003566.html
> 
> 
> So until Cython is fixed, you could hack the generated C++ from this:
> 
> 
> p->__pyx_v_it.std::map<__pyx_t_7sklearn_5utils_9fast_dict_ITYPE_t,__pyx_t_7sklearn_5utils_9fast_dict_DTYPE_t>::iterator::~iterator();
> 
> 
> into this (with parentheses for locally scooping typedef's):
> 
> 
> {
>       typedef __pyx_t_7sklearn_5utils_9fast_dict_ITYPE_t ITYPE;
>       typedef __pyx_t_7sklearn_5utils_9fast_dict_DTYPE_t DTYPE;
>       typedef std::map<ITYPE,DTYPE>::iterator it;
>       p->__pyx_v_it.~it();
> }
> 
> 
> A Python script could do this if you care to write one (just stating the 
> obvious).
> 
> 
> Sturla
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to