folly::Init, RAII variant of folly::init
[folly.git] / folly / Unit.h
index cfc2703b0437eedfdd49d4a04352b9e88b05d78b..52f38fcfaf3caaa325bae8810b89b76c21bfd124 100644 (file)
@@ -43,12 +43,20 @@ struct Unit {
   template <typename T>
   struct Lift : std::conditional<std::is_same<T, void>::value, Unit, T> {};
   template <typename T>
+  using LiftT = typename Lift<T>::type;
+  template <typename T>
   struct Drop : std::conditional<std::is_same<T, Unit>::value, void, T> {};
-
-  bool operator==(const Unit& /*other*/) const { return true; }
-  bool operator!=(const Unit& /*other*/) const { return false; }
+  template <typename T>
+  using DropT = typename Drop<T>::type;
+
+  constexpr bool operator==(const Unit& /*other*/) const {
+    return true;
+  }
+  constexpr bool operator!=(const Unit& /*other*/) const {
+    return false;
+  }
 };
 
 constexpr Unit unit {};
 
-}
+} // namespace folly