Chromium Code Reviews| Index: base/metrics/histogram_macros.h |
| diff --git a/base/metrics/histogram_macros.h b/base/metrics/histogram_macros.h |
| index 63cca694e9ad2d3d5ab36b99b6b426f14e628692..ded241b9906686992c72029b659d2e7d50b855af 100644 |
| --- a/base/metrics/histogram_macros.h |
| +++ b/base/metrics/histogram_macros.h |
| @@ -41,10 +41,15 @@ |
| // delete and reused. The value in |sample| must be strictly less than |
| // |enum_max|. |
| -#define UMA_HISTOGRAM_ENUMERATION(name, sample, enum_max) \ |
| - INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG( \ |
| - name, sample, enum_max, \ |
| - base::HistogramBase::kUmaTargetedHistogramFlag) |
| +#define UMA_HISTOGRAM_ENUMERATION(name, sample, enum_max) \ |
| + static_assert( \ |
|
Alexei Svitkine (slow)
2016/11/02 15:48:47
Thanks for working on this!
Just a nit, can you m
wychen
2016/11/02 21:45:04
Done.
|
| + !std::is_enum<decltype(sample)>::value || \ |
| + !std::is_enum<decltype(enum_max)>::value || \ |
| + std::is_same<std::remove_const<decltype(sample)>::type, \ |
| + std::remove_const<decltype(enum_max)>::type>::value, \ |
| + "UMA_HISTOGRAM_ENUMERATION type incompatible"); \ |
| + INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG( \ |
| + name, sample, enum_max, base::HistogramBase::kUmaTargetedHistogramFlag) |
| // Histogram for boolean values. |