This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Make ArrayRef constexpr friendly
Changes PlannedPublic

Authored by njames93 on May 17 2022, 2:29 PM.

Details

Summary

This class is similar to std::span which uses constexpr for most member functions, theres no reason ArrayRef shouldn't be the same.

Diff Detail

Event Timeline

njames93 created this revision.May 17 2022, 2:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 2:29 PM
njames93 published this revision for review.May 18 2022, 12:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 12:10 PM

Test coverage? (possibly just modifying much of the existing testing to occur in a constexpr context, if possible)

Test coverage? (possibly just modifying much of the existing testing to occur in a constexpr context, if possible)

I was wondering what the best way for tests would be. Guessing static asserts is the correct way

njames93 planned changes to this revision.May 22 2022, 2:10 AM

Gonna put this on postpone until we start using c++17 as many things which should be constexpr just aren't as we are using c++14