]> git.ipfire.org Git - thirdparty/squid.git/commit
Make Optional<bool> trivially copyable (#1188)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 1 Dec 2022 05:49:57 +0000 (05:49 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 1 Dec 2022 08:04:30 +0000 (08:04 +0000)
commitc5f6c5568788c90a75dcffbd136a7daed2f8e658
tree87969140c0de846cd747cf8f305d240b0865060b
parent3711bb6495b3b772b853320dc068b975369b7410
Make Optional<bool> trivially copyable (#1188)

    ipc/TypedMsgHdr.h: static assertion failed: putPod() used for a POD
    ActionParams.cc:44: required from here [with Pod = RequestFlags]

The known XXX in Optional destructor has started to bite us because
pending changes expose memcpy(3)-based IPC serialization code to
Optional<bool> flags. It is possible to mimic standard std::optional
implementations, avoiding that XXX, but that requires rather
sophisticated C++ tricks with placement new() and such. Specializing the
whole Optional is a better alternative for this _temporary_ class IMO.
src/base/Optional.h