[C++-sig] No automatic upcasting with std::shared_ptr in function calls?

2012-04-20 Thread VáclavŠmilauer
Hello, I have a sample hierarchy of polymorphic classes (A from which B inherits). One of them (A1, B1) is managed with boost::shared_ptr, the other one (A2, B2) via std::shared_ptr (I defined the get_pointer template for std::shared_ptr). When I call f1(boost::shared_ptr) with an object B1 from

Re: [C++-sig] Exposing 128-bytes aligned datatype

2012-02-21 Thread VáclavŠmilauer
> 128 *byte* alignment? Wow. No, no compiler will support that legally > as it would crap all over your stack frame. I vaguely remember that > GCC caps alignment to 40 bytes due to some supported architecture's > stack frame being incapable of going higher. > If you're aligning to 128 bytes the

Re: [C++-sig] Exposing 128-bytes aligned datatype

2012-02-21 Thread VáclavŠmilauer
> Aligning to 128 bits is surely __attribute__((__aligned__(16)))? Oops, I wrote it wrong in the title, it is 128-bytes aligned, double[16] with natural alignment, i.e. __attribute__((aligned(128))). Thanks for comments, I will try to put it into the bugtracker. ___

[C++-sig] Exposing 128-bit aligned datatype

2012-02-20 Thread VáclavŠmilauer
I am exposing a struct which is 128-bit aligned to python; it is always constructed dynamically in c++ code, hence there is no trouble that the alignment is correct. I was getting errors on compilation and had to add this bit to my code: namespace boost { namespace align { struct __attribu

Re: [C++-sig] constructing aligned instance in python

2012-02-13 Thread VáclavŠmilauer
> Hmm. You might be able to make this work with another class that holds > the AlignedType and has an implicit conversion to it: Nice trick, it surprisingly compiled. I found meanwhile though that the problem is more general: whenever a new instance of AlignedType is created from python, it wil

Re: [C++-sig] Boost converter for passing std::vector object by reference into a function??

2012-02-12 Thread VáclavŠmilauer
> One could imagine writing a fancy converter that would allow the first > form by making a temporary std::vector, passing that to the C++ > function, and then copying the elements in the vector back into the > Python list. But that's potentially a very expensive sequence of > operations, and

Re: [C++-sig] boost::python handles boost::shared_ptr specially...

2012-02-12 Thread VáclavŠmilauer
> Will std::shared_ptr just work also? I asked this question some time ago here: http://stackoverflow.com/questions/6568952/c0x-stdshared-ptr-vs-boostshared-ptr To summarize: you need to define free get_pointer functions for T=your shared_ptr type and it will work. I eventyallu did not go that way

Re: [C++-sig] AttributeError: 'Boost.Python.StaticP roperty' object attribute '__doc__' is rea d-only

2009-08-30 Thread VáclavŠmilauer
Such is the shortest example I am able to isolate (nothing py++ specific). Should I report that as bug? Against boost::python? I hope some expert will be able to comment on that. $ cat foo.cc #include struct Foo{ static int bar; }; int Foo::bar=3; BOOST_PYTHON_MODULE(foo){

Re: [C++-sig] [py++] AttributeError: 'Boost.Pytho n.StaticProperty' object attribute '__doc_ _' is read-only

2009-08-29 Thread VáclavŠmilauer
> Are you using Ubuntu 9.10 (karmic)? > > We are trying to fix the very same issue on PySide, and so far the > problem seems only to happen on Karmic. On Ubuntu 9.04 (jaunty) the > same binary package works fine. Hi, yes, I am at ubuntu karmic. (It was me discussing that with you on IRC a few da