Add additional instantiations in Instantiations.cpp
authorAdam Simpkins <simpkins@fb.com>
Fri, 16 Jan 2015 02:35:56 +0000 (18:35 -0800)
committerwoo <woo@fb.com>
Mon, 2 Feb 2015 21:12:23 +0000 (13:12 -0800)
commit72153cdf1d938ecad9f02bc23edcb84ea67d2731
treed7bf9da9cedf39b640e17f2322967a9aeb60ed19
parent5667f45e4b2879ebb0d64418d82c0c2d5afc4204
Add additional instantiations in Instantiations.cpp

Summary:
Histogram::getPercentileBucketIdx() and getPercentileEstimate() are
implemented using template methods of HistogramBuckets.

This updates Instantiations.cpp to also instantiate the versions of
these template methods that are required by Histogram<int64_t>.  Without
this, anyone using these methods was required to also include
Histogram-defs.h, or otherwise they may get link errors.  This makes it
so they no longer need to include Histogram-defs.h

The C++ syntax required is pretty horrendous.  We could potentially
avoid this by refactoring the code so that these methods are no longer
templates (and require that the Bucket class provide methods for this
purpose).  At the moment adding instantiations seems simpler, and
doesn't change any public APIs.

Test Plan:
Successfully linked code using
Histogram<int64_t>::getPercentileEstimate() without including
Histogram-defs.h

Reviewed By: ldbrandy@fb.com, meyering@fb.com

Subscribers: trunkagent, doug, net-systems@, exa, folly-diffs@

FB internal diff: D1786346

Signature: t1:1786346:1421429734:da17b7ea326c64a1e158fec3b87dc49c3db3d848
folly/stats/Instantiations.cpp