// Code for offset_of function from https://gist.github.com/graphitemaster/494f21190bb2c63c5516 template struct offset_of_impl { static T2 object; static constexpr size_t offset(T1 T2::*member) { return size_t(&(offset_of_impl::object.*member)) - size_t(&offset_of_impl::object); } }; template T2 offset_of_impl::object; template inline constexpr size_t offset_of(T1 T2::*member) { return offset_of_impl::offset(member); }