Companiesslug: daniel-lemire-s-blogOfficial Website

Daniel Lemire's blog

Daniel Lemire 博客

Technical blog by computer scientist Daniel Lemire focused on high-performance programming, algorithms and data processing.

Curated Intelligence

1 items · Page 1/1
Hacker News AIT2·Tools
42 pts
In C++, = default and {} Constructors Differ in Semantics

Daniel Lemire explains that writing an empty default constructor as `= default` versus `{}` in C++ yields very different semantics and performance: the former keeps the type trivial so value-initialization zeroes the whole object including padding, while the latter is user-provided and no longer zeroes members. The distinction directly affects initialization cost and correctness for lightweight structs like span.