Make the core runtime C++11/14/17/20 compatible (#127)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/127 Tweak the core runtime code to build cleanly with C++11 as well as with more recent versions. This only covers non-test targets under //executorch/runtime, enough to build `:size_test`. While doing this I removed a bunch of `constexpr` from methods on `ArrayRef` and `string_view`, because C++11 was more strict about what's allowed in them. While they're useful on general-purpose implementations of those types, we never do static comparison of array or string instances, so it doesn't help us. Not worth the complexity of adding `#ifdef`s to change the behavior depending on the C++ version. A lot of the template changes deal with the lack of `<base>_t` templates in C++11. Most of them are of the form ``` template<class T> using BASE_t = typename BASE<T>::type; ``` so the fix was to inline that pattern: add `typename` to the front and `::type` to the end. Reviewed By: larryliu0820 Differential Revision: D48665438 fbshipit-source-id: 85045b86eeaecf15c36b6bfce2497af3a84bdf50
D
Dave Bort committed
36624783016db5f66053d09c46d07acd01ebad0f
Parent: ae8c6d9
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 8/28/2023, 9:10:41 PM