#include "str_intrusion.h" //this function is horribly jank template struct result { typedef typename Tag::type type; static type ptr; }; template typename result::type result::ptr; template struct rob : result { struct filler { filler() { result::ptr = p; } }; static filler filler_obj; }; template typename rob::filler rob::filler_obj; struct string_length { typedef void (std::string::*type)(size_t); }; template class rob; struct string_data { typedef void (std::string::*type)(char *); }; template class rob; StrFromSV_Wrapper::StrFromSV_Wrapper() noexcept {} StrFromSV_Wrapper::StrFromSV_Wrapper(std::string_view sv) noexcept { (str.*result::ptr)((char *)sv.data()); (str.*result::ptr)(sv.size()); } StrFromSV_Wrapper::~StrFromSV_Wrapper() noexcept { (str.*result::ptr)(nullptr); (str.*result::ptr)(0); }