From: Eric Niebler Date: Mon, 3 Jul 2017 21:13:27 +0000 (-0700) Subject: constexpr the Unit comparison ops X-Git-Tag: v2017.07.10.00~18 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c6f344a95922a7b998de98b7bf2d85e1f9bf0a60;p=folly.git constexpr the Unit comparison ops Summary: `constexpr` All The Things! Reviewed By: Orvid Differential Revision: D5364910 fbshipit-source-id: 11abeb8adc38aef3ac4f2596ecf0f533b9e74203 --- 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 {};