A while back there was discussion of detecting smart pointers. The discussion started with Ovanes Markarian
Date: Thu, 22 Jun 2006 19:19:07 +0200 (CEST)
From: "Ovanes Markarian" <
om_boost@keywallet.com>
Subject: [Boost-users] inspecting templates and boost::is_pointer
To: boost-users@lists.boost.org
Message-ID:
<41230.194.138.18.132.115099674
7.squirrel@www.keywallet.com>
Content-Type: text/plain;charset=iso-8859-1
Hello all,
I am trying to specialize boost::is_pointer so, that it can determine if a type is a pointer
wrapper (shared_ptr, auto_ptr, weak_ptr).
.....
And, first off, yes, we now know that expanding is_pointer would be bad. So, instead we want 'is_pointer_like' or something like that.
There were suggestions regarding detecting operator->() and/or unary operator *().
What ever came of this? I am asking, of course, because I could really use an 'is_pointer_like<>' or 'is_smart_ptr' right now.
And if it is still unsolved, I've got 2 more suggestions:
detecting that boost::get_pointer() (for boost::bind) has been defined,
and/or
just looking for some common internals of the smart_ptrs (hack!) - or adding some common internal typedef/value - ie T::is_smart_pointer.
Thanks,
Tony