Paul Fultz II

Results 279 comments of Paul Fultz II

> The original code is not very unreadable imho just more verbose. I agree.

I wonder if `small_vector` could be implemented using custom allocators, which would also allow for `smalll_map` or `small_set`.

Actually this may be of interest: https://howardhinnant.github.io/stack_alloc.html

There are actually a lot of other places where we return vectors of size 1 or 2(such as `Analyzer::evaluate` or `Interval` member fields) which seems like they could benefit from...

I see, I was thinking the arena was stored in the allocator. I did find this simple `small_vector` implementation that uses a custom allocator and then inherits from `std::vector` so...

I actually found this library: https://github.com/alandefreitas/small Its header-only(so it should be easy to copy into our external directory). However, this requires C++17. We could create type aliases that fallback on...

Also, caffe2 uses a copy of LLVM's SmallVector class but removes dependencies on extra LLVM constructs: https://github.com/pytorch/pytorch/blob/master/c10/util/SmallVector.h We would just need to define `AlignedCharArrayUnion` and `C10_IS_TRIVIALLY_COPYABLE` to make it completely...

I dont really understand why we are just reducing `const_cast` instead of fixing them in the first place, as this seems to make it harder to fix in the future.

> And I have the feeling that clang can do a better job than cppcheck ever will with complex templates etc.. We dont just have a problem with complex templates,...

@danmar Any feedback on this PR?