libhal-google / libhal-util

libhal utility functions, interface wrappers, and types to help manage usage of embedded resources
Apache License 2.0
1 stars 4 forks source link

Generate error when `static_callable`'s object is trivially moveable #66

Open kammce opened 1 year ago

kammce commented 1 year ago

Typically, drivers will use a lambda that captures this when using static_callable. When the object is moved, this points to invalid memory. The move constructor should do the work of reestablishing the interrupt to point to the new location. At this moment, this operation is not trivial and must be done manually for each platform driver that utilizes interrupts/static callable, unfortunately.

https://en.cppreference.com/w/cpp/types/is_move_constructible https://en.cppreference.com/w/cpp/types/is_move_assignable