From 9db19499252beb8fc865343e65e57c7117ef0b2f Mon Sep 17 00:00:00 2001 From: Wyatt Hepler Date: Tue, 7 Feb 2023 17:51:48 +0000 Subject: pw_protobuf: Avoid CTAD on const container with non-const elements Specify the span template argument instead of relying on class template argument deduction (CTAD) for a temporary array with non-const elements. std::span CTAD does not work in this scenario, though there is a deduction guide for const std::array&. Having GetDoubleArray() return const std::array also would fix this. Change-Id: Ie1b622ddb4f4244dae82c1b6ea15275468118c4a Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/128312 Reviewed-by: Ted Pudlik Commit-Queue: Auto-Submit Pigweed-Auto-Submit: Wyatt Hepler --- pw_protobuf/size_report/proto_bloat.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pw_protobuf') diff --git a/pw_protobuf/size_report/proto_bloat.cc b/pw_protobuf/size_report/proto_bloat.cc index 542653d15..9d5884422 100644 --- a/pw_protobuf/size_report/proto_bloat.cc +++ b/pw_protobuf/size_report/proto_bloat.cc @@ -200,7 +200,7 @@ void CodeToPullInProtoEncoder() { child.WritePackedBool(8, GetBoolArray()); child.WriteRepeatedBool(8, GetBoolVector()); - encoder.WriteBytes(93, as_bytes(span(GetDoubleArray()))); + encoder.WriteBytes(93, as_bytes(span(GetDoubleArray()))); encoder.WriteString(21343, kTestString); } -- cgit v1.2.3