Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes

A thread-safe simple logger

printf() and friends are thread-safe While originally the C standard did not mention threads or thread-safety at all, most standard library implementations already ...
G. Sliepen's user avatar
  • 57.7k
6 votes
Accepted

Generic overloading bitwise functions to manipulate the enum type

All overloads can be made constexpr You can make all the overloaded functions constexpr, so they can be used in expressions that ...
G. Sliepen's user avatar
  • 57.7k
6 votes
Accepted

Using builder pattern and facade pattern in real project

When to use design patterns I wonder if it is suitable to use builder pattern and facade pattern here. The patterns from the book Design Patterns rely exclusively on object oriented features, and ...
G. Sliepen's user avatar
  • 57.7k
6 votes

A thread-safe simple logger

Support Logging to any std::ostream Currently, you only log to stdout from the C standard library. It would be better to tell ...
Davislor's user avatar
  • 7,636
6 votes
Accepted

A simple text editor

It's indeed a naive implementation Using a single std::string to store the contents of a document is a very naive design for a text editor. While it might be good ...
G. Sliepen's user avatar
  • 57.7k
4 votes

A thread-safe simple logger

Obsolete typedef enum ... Syntax Only in C, structs/enums/unions inhabited a separate namespace so that you needed to refer to them as ...
uli's user avatar
  • 1,705
3 votes

Generic overloading bitwise functions to manipulate the enum type

Consider std::to_underlying You can replace static_cast<udl_type>(a) with ...
Davislor's user avatar
  • 7,636
2 votes

A thread-safe simple logger

Setting the block level could create a data race. Writes to the block level by set_block_level are not synchronized with reads from ...
ComicSansMS's user avatar
2 votes
Accepted

Overloading bit operators for scoped enum

Naming things Since MODULE_ENABLED is a scoped enum, the names of the enum values are not in the global namespace, so you don't need to prefix them with ...
G. Sliepen's user avatar
  • 57.7k

Only top scored, non community-wiki answers of a minimum length are eligible