X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FUnit.h;h=52f38fcfaf3caaa325bae8810b89b76c21bfd124;hp=f1c71618894b0920aff61a7f4fd1ca9724c6834f;hb=d5b67c256c7423d74f4794d7fe421ed239807be4;hpb=b6746598f0ad8cbcbe0b0da90c035ba5d3f1aab7 diff --git a/folly/Unit.h b/folly/Unit.h index f1c71618..52f38fcf 100644 --- a/folly/Unit.h +++ b/folly/Unit.h @@ -1,5 +1,5 @@ /* - * 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. @@ -43,12 +43,20 @@ struct Unit { template struct Lift : std::conditional::value, Unit, T> {}; template + using LiftT = typename Lift::type; + template struct Drop : std::conditional::value, void, T> {}; - - bool operator==(const Unit& /*other*/) const { return true; } - bool operator!=(const Unit& /*other*/) const { return false; } + template + using DropT = typename Drop::type; + + constexpr bool operator==(const Unit& /*other*/) const { + return true; + } + constexpr bool operator!=(const Unit& /*other*/) const { + return false; + } }; constexpr Unit unit {}; -} +} // namespace folly