Skip to content
Commit aa55610f authored by Noah Davis's avatar Noah Davis 🌵
Browse files

History: fix strict-aliasing warnings by using std::ranges

With this patch, we no longer use reinterpret_cast to make the underlying data of the shared pointers in the undo and redo lists immutable.

Now we use std::ranges::transform_view and std::static_pointer_cast to make the underlying data immutable.

We also use std::ranges::subrange instead of std::span because std::span doesn't work with std::ranges views.

Gentoo and openSUSE Tumbleweed get strict-aliasing warnings with the -flto and -O3 GCC flags with the old behavior using reinterpret_cast.

Also see !321 (comment 969233)
parent 27d92396
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment