libexpr: Lessen const bound on Value::listElems() const

I do not like this being a requirement, but it is necessary to make the
C api work with the least amount of ABI changes.

listElems() const returns a constant pointer to N constant pointers of
Value. This bound is lessened (within defined behavior) to a constant
pointer to N *mutable* pointers of Value. The upstream reasoning behind
this is reasonable enough, though I strongly distrust it.

It might be better to drop the `const` off of the C ABI instead.

Change-Id: I8e750b086c1b8d13972aa748ce8f6139f6bcbadb
This commit is contained in:
puck 2024-03-17 16:20:44 +00:00
parent 7f9e09a434
commit de17a2f0fa

View file

@ -384,7 +384,7 @@ public:
return internalType == tList1 || internalType == tList2 ? smallList : bigList.elems;
}
const Value * const * listElems() const
Value * const * listElems() const
{
return internalType == tList1 || internalType == tList2 ? smallList : bigList.elems;
}