Is this downcast undefined behaviour?

I am trying to extend std::map‘s std::pair entries with some extra functionality and want to cast such pairs to a child class of pair. Note that this is the "wrong" direction of polymorphism, the child is not the parent. But since the memory layout should be identical as long as I am not introducing additional… Read More Is this downcast undefined behaviour?

Using std::bind with overloaded methods in namespace in C++

#include <iostream> #include <map> #include <functional> namespace xAOD{ namespace EgammaParameters{ enum ShowerShapeType{ var1 = 0, var2 = 1, var3 = 3 }; }; class Photon{ public: // I don’t want to use this overload //double test(float& value, const EgammaParameters::ShowerShapeType information) const {return 1;} // I want to use this overload double test(const EgammaParameters::ShowerShapeType information) const… Read More Using std::bind with overloaded methods in namespace in C++