Commit c6f344a9 authored by Eric Niebler's avatar Eric Niebler Committed by Facebook Github Bot

constexpr the Unit comparison ops

Summary: `constexpr` All The Things!

Reviewed By: Orvid

Differential Revision: D5364910

fbshipit-source-id: 11abeb8adc38aef3ac4f2596ecf0f533b9e74203
parent e81cc5a0
...@@ -45,8 +45,12 @@ struct Unit { ...@@ -45,8 +45,12 @@ struct Unit {
template <typename T> template <typename T>
struct Drop : std::conditional<std::is_same<T, Unit>::value, void, T> {}; struct Drop : std::conditional<std::is_same<T, Unit>::value, void, T> {};
bool operator==(const Unit& /*other*/) const { return true; } constexpr bool operator==(const Unit& /*other*/) const {
bool operator!=(const Unit& /*other*/) const { return false; } return true;
}
constexpr bool operator!=(const Unit& /*other*/) const {
return false;
}
}; };
constexpr Unit unit {}; constexpr Unit unit {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment