Это UB? Есть ли возмодность сделать аналогичное без UB? Если это UB то по каким причинам?
template<typename K, typename V>
struct CPair {
  K key;
  V value;
};
int main()
{
  std::map<int, std::string> sp {{42, "test"}};
  CPair<int, std::string> *p =
  reinterpret_cast<CPair<int, std::string>*> (&(*sp.find(42)));
  std::cout << p->key << " " << p-> value;
}








