/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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