Remove ConditionallyExistent, because it violates the C++ spec
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 11 Aug 2016 18:08:33 +0000 (11:08 -0700)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Thu, 11 Aug 2016 18:23:36 +0000 (11:23 -0700)
commit7ef3c1b23149d7ad32eb685a7e4832358ff5792e
tree9b125086899f72416c8180379d04c25e981e349d
parentefc54c28e4922cb8f1d4904dd9674c4c9a3b825c
Remove ConditionallyExistent, because it violates the C++ spec

Summary:
[Folly] Remove `ConditionallyExistent`, because it violates the C++ spec.

The spec says that struct and class types occupy at least one byte. But the point of this class is to occupy zero bytes when the condition is false. That can't be made to work.

GCC and Clang support an extension allowing, in some cases, structs to occupy no space at all. But it violates the spec, and MSVC does not support the extension.

There is, sort of, the possibility of empty-base-class-optimization. But it will be very painful to use, and it will only work in some cases.

Since this is broken now, and fixing it would violate the C++ spec and break this under MSVC, it's better just to remove it.

Reviewed By: nbronson, Orvid

Differential Revision: D3696371

fbshipit-source-id: c475c6e15d9ff1bc4c44dc7e336ce74e6db640ef
folly/ConditionallyExistent.h [deleted file]
folly/Makefile.am
folly/test/ConditionallyExistentTest.cpp [deleted file]
folly/test/Makefile.am