X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FUnit.h;h=cfc2703b0437eedfdd49d4a04352b9e88b05d78b;hb=6b1a43fd0712c15cb98f134bc2d8c89713b24513;hp=df99eba27bebfb0bfc0ad8276d840e466bcd4481;hpb=004d6c170bf77139af25f7ff6024637cee5ce58b;p=folly.git diff --git a/folly/Unit.h b/folly/Unit.h index df99eba2..cfc2703b 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. @@ -34,10 +34,16 @@ namespace folly { /// possible to construct a value of this type, but it is always the same value /// every time, so it is uninteresting. struct Unit { + // These are structs rather than type aliases because MSVC 2017 RC has + // trouble correctly resolving dependent expressions in type aliases + // in certain very specific contexts, including a couple where this is + // used. See the known issues section here for more info: + // https://blogs.msdn.microsoft.com/vcblog/2016/06/07/expression-sfinae-improvements-in-vs-2015-update-3/ + template - using Lift = std::conditional::value, Unit, T>; + struct Lift : std::conditional::value, Unit, T> {}; template - using Drop = std::conditional::value, void, T>; + struct Drop : std::conditional::value, void, T> {}; bool operator==(const Unit& /*other*/) const { return true; } bool operator!=(const Unit& /*other*/) const { return false; }