Affective C++ · X (formerly Twitter)

Affective C++ profile banner

user avatar

The authoritative guide for High Quality C++! (Warning: These are all jokes.)

Joined September 2018

  • Pinned

    user avatar

  • user avatar

    Item 80: A typical source of error is (transitively) including the same header file in many compilation units. This is an ODR violation. Instead, make a separate copy of that header file for each source file. #cplusplus #cpp #affectivecpp

  • user avatar

    Item 79: Choosing the right data structure is critical. Is memset too slow? Consider memunordered_set instead, to avoid the red-black tree in favor of hashing. See also memmap for key/value, mempriority_queue, memstack, etc. (thanks

    @jfbastien

    ) #cplusplus #cpp #affectivecpp

  • user avatar

  • user avatar

    Item 77: The difference between char and wchar_t is that char is for narrow characters, and wchar_t is for wide characters. Store letters like i and j in a char, and letters like m and w in a wchar_t. (Thanks

    @chrisoldwood

    ) #cplusplus #cpp #affectivecpp

Read the original on x.com ↗