From a02bd0ded1d193e3fe6f0bfb961138e0f212fccc Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 21 Nov 2022 16:33:36 -0800 Subject: [PATCH] Add explicit defaulted copy ctor to `Values` (#1176) Summary: X-link: https://github.com/facebook/yoga/pull/1176 `Values` is a wrapper to story an array of YGValue's as CompactValues. From https://github.com/facebook/yoga/issues/1174 we see a warning `Wdeprecated-copy` beacuse a user-defined copy constructor is not present, but a user-defined asignment operator is (the defaulted one). This adds an explicitly defaulted copy contructor which should silence the warning I think. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D41447490 fbshipit-source-id: 8cc8f291cf12014d87cc71c4598bb84fdd6cd930 --- ReactCommon/yoga/yoga/Yoga-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReactCommon/yoga/yoga/Yoga-internal.h b/ReactCommon/yoga/yoga/Yoga-internal.h index 4e0efa6074d..9444bb5d1db 100644 --- a/ReactCommon/yoga/yoga/Yoga-internal.h +++ b/ReactCommon/yoga/yoga/Yoga-internal.h @@ -110,6 +110,8 @@ private: public: Values() = default; + Values(const Values& other) = default; + explicit Values(const YGValue& defaultValue) noexcept { values_.fill(defaultValue); }