From 9432d632ddea663265b135d859c18f2adda982f7 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 8 Aug 2017 20:27:39 -0700 Subject: [PATCH] Let IPAddressV4::bitCount and IPAddressV6::bitCount be constexpr Summary: [Folly] Let `IPAddressV4::bitCount` and `IPAddressV6::bitCount` be `constexpr`. Reviewed By: meyering Differential Revision: D5589954 fbshipit-source-id: f4208efd62e71f47a7c87bdc8ddd421f93413c29 --- folly/IPAddressV4.h | 2 +- folly/IPAddressV6.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/IPAddressV4.h b/folly/IPAddressV4.h index 93651577..4b0b8799 100644 --- a/folly/IPAddressV4.h +++ b/folly/IPAddressV4.h @@ -140,7 +140,7 @@ class IPAddressV4 { * @see IPAddress#bitCount * @returns 32 */ - static size_t bitCount() { + static constexpr size_t bitCount() { return 32; } diff --git a/folly/IPAddressV6.h b/folly/IPAddressV6.h index 8590993c..05cc5bdc 100644 --- a/folly/IPAddressV6.h +++ b/folly/IPAddressV6.h @@ -173,7 +173,7 @@ class IPAddressV6 { * @see IPAddress#bitCount * @returns 128 */ - static size_t bitCount() { + static constexpr size_t bitCount() { return 128; } -- 2.34.1