Any file constructing lite_tuple should contain this after #include`s: FOLLY_PUSH_WARNINGS FOLLY_DETAIL_LITE_TUPLE_ADJUST_WARNINGS Followed by `FOLLY_POP_WARNING at the bottom. The reason is that ‐Wmissing‐braces otherwise breaks deduction guides, and makes aggregate initialization a real headache to use: lite_tuple::tuple t{1, 2, 3}; // before :) lite_tuple::tuple<int> t{{{1}, {2}, {3}}}; // after :'(
Synopsis
Declared in <folly/detail/tuple.h>
#define FOLLY_DETAIL_LITE_TUPLE_ADJUST_WARNINGS
Description
At the same time, I don't want to give up on having it be an aggregate type, because (1) aggregate types should get copy elision when initialized from prvalues ‐‐ but a perfect‐forwarding constructor would break that, and (2) not being an aggregate type might break register‐pass optimizations.
So, instead I replace ‐Wmissing‐braces by ‐Wmissing‐field‐initializers, which has its correctness benefits without any of the bad side effects.
FIXME: Remove when our warnings are fixed to be this way globally.
Created with MrDocs