
On 5/30/2010 2:39 AM, Joaquin M Lopez Munoz wrote:
Thorsten Ottosen<thorsten.ottosen<at> dezide.com> writes: [...]
Joaquin, what is your take on this?
I concur with Jeff's poins of view in both respects:
* make_guard_if<cond> should construct the guard if cond is true (I overlooked the fact that your implementation does the opposite, sorry). I think this is the obvious semantics for anyone reading the construct: make a guard if so and so. * It'd be nice if we have both the following:
template<typename IsNull, ...> inline typename null_guard_return<..>::type make_guard_if(...)
template<bool is_null, ...> inline typename null_guard_return<..>::type make_guard_if_c(...)
Of course, you mean IsNonNull / is_non_null (or equivalent semantics) for the template parameters...
just like enable_if and enable_if_c, which is probably the closest existing practive we've got in Boost.
As for make_guard_unless (and make_guard_unless_c) I guess it's up to you to provide it also, at the risk of being a little overabundant at providing variations on the same basic theme.
There *is* disable_if / disable_if_c, and even lazy_* versions, so there is precedent at very explicitly providing such variations. - Jeff