smeenai added inline comments.
================
Comment at: llvm/include/llvm/ADT/SmallVector.h:52
+ // The maximum size depends on size_type used.
+ static constexpr size_t SizeMax() {
+ return std::numeric_limits<Size_T>::max();
----------------
browneee wrote:
> dexonsmith wrote:
> > STL data structures have a name for this called `max_size()`. Should we be
> > consistent with that?
> Good question.
>
> This brought my attention to the existing
> SmallVectorTemplateCommon::max_size() which also needed to be updated.
> I'm going to name this new function SizeTypeMax to best describe what it
> provides, and leave it separate from max_size().
Was it intentional to make this return a `size_t` rather than a `Size_T`? Clang
gives a truncation warning on 32-bit platforms when you try to instantiate the
template with `uint64_t` as a result.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77621/new/
https://reviews.llvm.org/D77621
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits