This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/4] Support using 'auto' in a function parameter list to introduce an implicit template parameter.

On 08/27/2013 03:42 PM, Adam Butcher wrote:
+  else // extend current template parameter list
+      // pop the innermost template parms into tparms

Most comments should start with a capital letter and end with a period.

+      for (size_t n = 0, end = TREE_VEC_LENGTH (inner_vec); n < end; ++n)
+	tparms = chainon (tparms, TREE_VEC_ELT (inner_vec, n));

Doing chainon in a loop has bad algorithmic complexity, as it walks through the whole tparms list each iteration. Better to build up a list from inner_vec and then chainon that list as a whole.

+template <typename TreePredicate>
+inline tree
+find_type_usage (tree t, TreePredicate pred)

I don't think this needs to be a template, since we know the predicates take a single tree and return bool.

I don't see any diagnostic for the implicit function template extension; my earlier comment about not controlling it with -std=c++1y vs gnu++1y didn't mean it should go away entirely. :)

Maybe we should call it part of c++1z, or just control the diagnostic with -pedantic.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]