From: Yiding Jia Date: Thu, 29 Nov 2012 23:05:39 +0000 (-0800) Subject: folly/stats - fix c++ spec compliance for call to template name X-Git-Tag: v0.22.0~1124 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3e8d7341f24b0d3383467e162c850f5b143468e7;p=folly.git folly/stats - fix c++ spec compliance for call to template name Summary: This code is not strictly correct per c++ spec section 14.2.4: > When the name of a member template specialization appears after . or -> in a > postfix-expression or after a nested-name-specifier in a qualified-id, and the > object or pointer expression of the postfix-expression or the > nested-name-specifier in the qualified-id depends on a template parameter > (14.6.2) but does not refer to a member of the current instantiation > (14.6.2.1), the member template name must be prefixed by the keyword template. > Otherwise the name is assumed to name a non-template. This causes clang to complain, but gcc is lax about this, as usual. Test Plan: compile stuff that use this. Reviewed By: delong.j@fb.com FB internal diff: D643515 --- diff --git a/folly/stats/BucketedTimeSeries.h b/folly/stats/BucketedTimeSeries.h index f343c483..87ca7e51 100644 --- a/folly/stats/BucketedTimeSeries.h +++ b/folly/stats/BucketedTimeSeries.h @@ -203,7 +203,7 @@ class BucketedTimeSeries { */ template ReturnType avg() const { - return total_.avg(); + return total_.template avg(); } /*