
On 07/08/2004 04:34 PM, David B. Held wrote:
Jonathan Turkanis wrote:
[...] Could you pull the definition of nested outside of sp
template<typename P1, typename P2, typename T> struct sp_nested { };
then use a metafunction within sp:
template<typename P1, typename P2> struct sp { template<typename T> struct nested { typedef sp_nested<P1, P2, T> type; }; }; [...]
For syntax reasons, this is an undesirable solution. Although, you could get pretty close by modifying it a little:
template<typename P1, typename P2> struct sp { template<typename T> struct nested : sp_nested<P1, P2, T> { }; };
[...] You can then make less< sp_nested<P1, P2, T> > do pretty much
whatever you want; the question is whether you can make the metafunction do whatever you needed the nested template to do.
The problem is that sp_nested<> would be an implementation detail that I would not want to expose to the user. So I would not want the user to have to mention it in order to instantiate less<>.
FWIW, there's rm_nondeduced at: http://cvs.sourceforge.net/viewcvs.py/boost-sandbox/boost-sandbox/boost/mana... which is vaguely similar to some of previous ideas. It's used at: cycle_basis_mgr.hpp refcycle_prox_visitor_abs.hpp It's just another variation and hopefully you can maybe merge the ideas and distill the best from all of them.