On 06/17/2013 02:10 PM, Andrew Sutton wrote:
You mean you don't need <algorithm> anymore in logic.cc? I think we want
the <cstdlib> include in general if we're going to support people using the
C++ standard library.
I don't. Those decisions are above my pay grade, so I'm doing my best
not to make them.
If you don't need the change for concepts any more, feel free to drop it.
Can friend temploids be constrained?
I have not thought deeply about constrained friend declarations. What
would a friend temploid look like?
I was thinking something like
template <class T> struct A {
T t;
requires Addable<T>()
friend A operator+(const A& a1, const A& a2)
{ return A(a1.t + a2.t); }
};
I'm not clear on the issue. Perhaps leaving processing_template_decl alone
and using fold_non_dependent_expr would accomplish what you want?
I don't think that will work. The problem comes from the instantiation
of traits (and some other expressions) during constraint checking.
When processing_template_decl is non-zero, finish_trait_expr will
create TRAIT_EXPR nodes, which aren't handled by the constexpr
evaluation engine.
Sure, but fold_non_dependent_expr should turn the TRAIT_EXPR into a more
useful form.
Can explicit specializations have constraints, to indicate which template
they are specializing?
Good question. I don't think so. I believe that it would be a
specialization of the most specialized function template whose
constraints were satisfied. So:
Makes sense.
Passing 'true' for require_all_args means no deduction will be done; rather,
all arguments must either be specified or have default arguments.
I see. It seems like I should be passing false here, since I want to
ensure that the resulting argument list can be used to instantiate the
template.
I think true is what you want, since there are no function arguments to
do argument deduction from. Passing true for require_all_args
guarantees that the result can be used to instantiate the template;
passing false can return an incomplete set of arguments that will be
filled in later by fn_type_unification.
Jason