C++ Features You Might Not Know - Jonathan Müller - NDC TechTown 2023

Discover little-known C++ features that can boost your programming skills, from lambda expressions to operators, unions, and more, in this comprehensive talk showcasing the complexities and quirks of the C++ language.

Key takeaways

C++ Features You Might Not Know

  • You can use a lambda that doesn’t capture anything implicitly convertible to a function pointer.
  • The comma operator is useful for combining expressions.
  • You can overload the comma operator for your iterator.
  • A union of two UN32s with padding between the UN8s.
  • The sign bit is set in Intel CPUs when you create a nan out of an operation.
  • The static keyword has multiple meanings.
  • The size of operator is useful for getting the size of an array.
  • You can use constexpr to create a constexpr lambda.
  • The short circuit behavior of logical operators can be useful.
  • You can use dynamic casts to get around covariant return types.
  • The standard library has some weird stuff, such as macros that define rounding modes.
  • You can use valarray to create an array of values.
  • The SIMD type is an array of values.
  • You can use lambdas with captures to create function pointers.
  • You can overload the -> operator to dereference a pointer to object.
  • You can use implicit conversions to get a function pointer from a lambda.
  • The std::runtime_error exception has a what() function that returns a std::string.
  • You can use auto to deduce the type of a variable.
  • The (round()) macro in C++ is used to round numbers.
  • You can use the std::valarray class to create an array of values.
  • The ssize_t type is an alias for int in some systems.
  • You can use the VS.yml file to configure Valgrind.
  • The clang compiler tells you if you have undefined behavior.
  • The sscanf function is used to read from a string.
  • The VA_ARGS macro is used to pass arguments to a function.
  • You can use the std::cout object to print to the console.
  • You can use the macro to print to the console with automatic formatting.
  • The std::cout object has an operator void() function.
  • The VA_ARGS macro is used to pass arguments to a function.
  • You can use the std::cout object to print to the console with automatic formatting.
  • The std::cout object has an operator void() function.
  • The std::cout object can be used to print to the console with automatic formatting.