> The only thing really bothering me now is the dual implementations of shared
> and unique assigners. If you could conditionally compile different stuff into
> the deleter depending of if the template argument was a uptr or sptr then you
> could collapse this down. You'd also be able to collapse the two assign_sptr
> and assign_uptr methods at the same time.
Function overloading?
~GObjectPtrAssigner()
{
if (_ptr)
{ do_stuff(_smart, _ptr);
}
}
> The only thing really bothering me now is the dual implementations of shared
> and unique assigners. If you could conditionally compile different stuff into
> the deleter depending of if the template argument was a uptr or sptr then you
> could collapse this down. You'd also be able to collapse the two assign_sptr
> and assign_uptr methods at the same time.
Function overloading?
~GObjectPtr Assigner( )
do_ stuff(_ smart, _ptr);
{
if (_ptr)
{
}
}
void do_stuff( std::shared_ ptr<TypeName> & _smart, element* _ptr)
_smart. reset(_ ptr, GlibDeleter< typename S::element_ type>() );
{
}
void do_stuff( std::unique_ ptr<TypeName> & _smart, element* _ptr)
_smart. reset(_ ptr, GObjectDeleter());
{
}