Changing behavior of 'any' and 'all' sinks, adding in 'isEmpty' and 'notEmpty' sinks
authorJoe Richey <jrichey@fb.com>
Tue, 14 Jul 2015 20:50:24 +0000 (13:50 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 15 Jul 2015 20:25:11 +0000 (13:25 -0700)
commit43d53e0668efb3b1c100949183362b931f979932
treed15ca0224a3a285ff5a03e35d79f8a7d067f9316
parentcc671d294c2d51022348ec684109c7d11742ab50
Changing behavior of 'any' and 'all' sinks, adding in 'isEmpty' and 'notEmpty' sinks

Summary: When adding in the 'filter()' default behavior, I considered adding in similar
behavior for 'any' and 'all'. However, we had 'any' with no funciton call
basically check if anything was present, not testing a predicate. This can
create a confusing senario, so I removed this behavior from 'any' and added in
the 'isEmpty' and 'notEmpty' sinks. Now the calls 'any()' and 'all()' (called
with parens, so old uses won't compile) check for truthy values simlar to
'filter()'.

I also added some unit tests and changed 'static const' objects to 'constexpr'.

Reviewed By: @ddrcoder

Differential Revision: D2234637
folly/gen/Base-inl.h
folly/gen/Base.h
folly/gen/test/BaseTest.cpp
folly/gen/test/ParallelBenchmark.cpp