Daily bit(e) of C++

Daily bit(e) of C++ is a Substack focused on C++ programming, offering insights into modern C++ practices, standard library improvements, language features introduced in recent standards, and common programming patterns and problems. It covers both basic and advanced topics, aiming to enhance the understanding and application of C++ for its readers.

Modern C++ Features C++ Standard Library Programming Patterns Software Development Tools Language-Specific Patterns and Practices Code Optimization and Efficiency Error Handling Memory Management C++ Standard Improvements Integration with C APIs

The hottest Substack posts of Daily bit(e) of C++

And their main takeaways
19 implied HN points 26 Jan 24
  1. offsetof only works for standard layout types
  2. pointer to a standard layout type and its first member are pointer-interconvertible
  3. standard layout union with standard layout structs allows access to common initial sequence through non-active members
19 implied HN points 25 Jan 24
  1. The std::find_first_of algorithm in C++ finds the left-most matching element in a range.
  2. Both ranges in std::find_first_of are not ordered, resulting in quadratic complexity.
  3. Subscribe to receive more posts and support the author's work.
19 implied HN points 21 Jan 24
  1. Unscoped enumerations introduce named constants into a scope.
  2. The compiler automatically selects the backing type, unless explicitly specified.
  3. C++11 Scoped Enumerations are generally preferred over unscoped ones.
19 implied HN points 19 Jan 24
  1. std::stack is a container adapter for stack/LIFO functionality in C++.
  2. It helps in avoiding recursion and can be used for implementing undo functionality.
  3. Subscribe to receive more C++ insights and support the author's work.
Get a weekly roundup of the best Substack posts, by hacker news affinity:
19 implied HN points 18 Jan 24
  1. C++20 introduced synchronized streams.
  2. Multiple synchronized streams can be used to write to a single destination stream without introducing data races.
  3. All accesses to a stream should be through a synchronized stream to avoid interleaving.
19 implied HN points 17 Jan 24
  1. The 'Rule of zero' is based on the single responsibility principle.
  2. A class should not have special member functions unless it's managing ownership.
  3. Following the 'Rule of zero' can help in avoiding complexity in class design.
19 implied HN points 11 Jan 24
  1. C++23 introduces std::print and std::println as alternatives to std::format for outputting to stdio FILE descriptors.
  2. Both std::print and std::println default to outputting to standard output (stdout).
  3. Subscribe to receive more Daily bit(e) of C++ posts and support the author's work.