logoalt Hacker News

locknitpickertoday at 4:04 AM0 repliesview on HN

> Unfortunately, I don't think there's getting away from just understanding value semantics to get the correct and/or performant behavior.

This is not specific to C++ though. It just so happens that C++ developers who feel this topic is important are those invested in performance optimization. For them, C++ offers them these types of tools.

Meanwhile, those who don't have a pressing need to go through great extents to optimize performance can simply fall back to the compiler generating most special member functions and then pay the performance tax of doing deep copies by default. For these cases, which I'd say corresponds to most C++ floating around, it's far more important to know the rules of when to define our own custom constructors and assignment operators.