David Abrahams writes:
Aleksey Gurtovoy wrote:
David Abrahams writes:
Aleksey Gurtovoy wrote:
'protect' is an identity wrapper for a Metafunction Class that prevents its argument from being recognized as a bind/placeholder expression.
The main usage for 'protect' is to prevent parametrized metafunction classes from being accidentally treated as a placeholder expression simply because their arguments happened to embed a placeholder.
Hum. Seems a bit counterintuitive that protect doesn't apply equally well to this case.
??? As I tried to explain in my previous reply, 'protect' already has a well-defined semantics in lambda expressions, and it's quite different from what is needed to support "nested scopes".
I understand that you said that, but to me what protect does (prevents the recognition and premature substition of placeholders)
It doesn't prevent a "premature substition" of placeholders. It prevents it once and for all.
looks very similar to what the OP wants. Also, maybe it's just a failure of my imagination, but I have a hard time seeing what the OP wants as "nested scopes."
Reciting the rewrite of the OP code from my original reply: template< typename Map, typename Entry > struct copy_entires // scope #2 : copy< typename Entry::second::entries , inserter