aurora-opensource / au

A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience.
Apache License 2.0
329 stars 21 forks source link

Use a simple indexed loop #329

Closed chiphogg closed 17 hours ago

chiphogg commented 1 day ago

Apparently, some platforms struggle with range-based for loops on C-style arrays. Other platforms don't seem to like the C-style array at all, so we're trying a std::array. You'd think we'd be able to use range-for with this... but, no, begin isn't constexpr until C++17, so we're using an indexed loop anyways.

Tested on the Aurora-internal code that revealed the problem.

Follow-up for #217.