From c6f344a95922a7b998de98b7bf2d85e1f9bf0a60 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Mon, 3 Jul 2017 14:13:27 -0700 Subject: [PATCH] constexpr the Unit comparison ops Summary: `constexpr` All The Things! Reviewed By: Orvid Differential Revision: D5364910 fbshipit-source-id: 11abeb8adc38aef3ac4f2596ecf0f533b9e74203 --- folly/Unit.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/folly/Unit.h b/folly/Unit.h index cfc2703b..0f90ff6e 100644 --- a/folly/Unit.h +++ b/folly/Unit.h @@ -45,8 +45,12 @@ struct Unit { template struct Drop : std::conditional::value, void, T> {}; - bool operator==(const Unit& /*other*/) const { return true; } - bool operator!=(const Unit& /*other*/) const { return false; } + constexpr bool operator==(const Unit& /*other*/) const { + return true; + } + constexpr bool operator!=(const Unit& /*other*/) const { + return false; + } }; constexpr Unit unit {}; -- 2.34.1