Re: RFC: glocal - automatically freeing memory when it goes out of scope



On 21/11/11 07:51 AM, Ross Burton wrote:
> We need a micro-C++ binding that looks exactly like traditional
> GObject C but also hooks up the nice features like stack allocated
> objects.  I don't like C++ but I'd consider a C++ compiler to compile
> my C code if it could simplify memory management dramatically for
> almost free. :)

You can do that just by using a boost::intrusive_ptr<> - or an equivalent.
But then you are gonna hit a lot of cases where you wish it was just C++
as you won't be able to pass it directly to glib or gtk functions, and
you'll have to play nice with casting.

Not saying it is impossible, but that it can get ugly.


Hub


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]