It's Friday isn't it, so I'm just going to scream AHHHHHHHHHHHHHHHHHHHHHHHH

The boost smart_ptrs are fine and dandy but, in the boost library that we are 
currently using, they are foul and digusting beasts. Why?

Because of this:

    template< typename T >
    inline void checked_delete(T * x)
    {
        BOOST_STATIC_ASSERT( sizeof(T) != 0 ); // assert type complete at 
point
                                               // of instantiation
        delete x;
    }

    template< typename T >
    inline void checked_array_delete(T  * x)
    {
        BOOST_STATIC_ASSERT( sizeof(T) != 0 ); // assert type complete at 
point
                                               // of instantiation
        delete [] x;
    }

It means that you can't ever write code so:

class SomeClass {
private:
        Struct Impl;
        boost::scoped_ptr<Impl> pimpl_;
}

or even nicer when it comes to a wrapper class to an FL_OBJECT
class Widget {
private:
        Struct Impl;
        boost::shared_ptr<Impl> pimpl_;
}


because that bloody BOOST_STATIC_ASSERT insists that it needs to see the 
SomeClass::Impl::~Impl(). 

Bollocks to it.

The light at the end of the tunnel is that this foulness has been removed in 
boost 1.27.

Thank you. I feel a little better now.
Angus

Reply via email to