101 reputation
2
bio website
location Hamburg, Germany
age 32
visits member for 1 year, 11 months
seen Sep 18 at 14:40

twitter: @arne_mertz

C++ - Geek, interested in a variety of topics, especially DSLs, version control


Sep
24
awarded  Autobiographer
Sep
18
comment Is it bad practice to use Inheritance to associate methods with a basic container?
Standard reference for my comment: C++11, [expr.delete], §5.3.5,3: "[...] if the static type of the object to be deleted is different from its dynamic type, the static type shall be a base class of the dynamic type of the object to be deleted and the static type shall have a virtual destructor or the behavior is undefined." (emphasis mine)
Sep
18
comment Is it bad practice to use Inheritance to associate methods with a basic container?
@glampert nope, the latter is not UB, since the static type of the pointer is the right one, so ~MTRegistrationParams is called. However, this would lead to UB: std::map<std::string, std::string>* pMap = new MTRegistrationParams(); delete pMap;
Sep
18
comment c++ coding practice class vs. “free” functions
Ironically, a mathematical vector would best be implemented by means of a std::array instead of a std::vector since the number of dimensions is fixed, i.e. the number of entries should be static (std::array) instead of dynamic (std::vector).
Jan
11
awarded  Supporter