What components are needed for a C ++ project that are not found in the shared library?

For most C ++ projects, Boost covers many of the components of the earth, but commonly used solutions and idioms require some work on the stove or on the ground. What do you think is so important that you will have it in every project and, therefore, have it in a small "library"? Some things I was thinking about:

  • Singleton base class (someone will think that he needs it, so he can do it right)
  • Scopeguard
  • Factory base class
  • any_iterator

(The last two are in Loki, but Loki overlaps with Boost, and people hesitate to use it.)

Edit: I could add that I am not asking about the usual extensions of the standard library, for example. copy_if.

+3
source share
8 answers

None of the above. In particular, it is definitely not the Singleton class, since the use of Singletons usually represents an indication of a design error . Over the past 15 years, I never needed the Singleton class, and all those that I found on my travels were hacks or otherwise compromised the reliability of the system in which they were located.

Generally speaking, besides a good compiler compatible with standards, the desire to never stop learning more about my choice of language and coding standards that do not restrict my movements, I found that I did not need anything to write complete systems.

, 15 , , Boost. Boost ​​ , , . Boost, . ++ 0x VS2010, .

, #include, , . :

  • sprintf, std::string
  • , , -
  • transform_if
  • copy_if

STL, .

+5

, ( ++ ), : . , , Boost, , , , . , , . - . Boost .

+2

, , :

  • assert utilities ( "start debugger", " ", " .." )
  • , "" ( HeapBuffer SharedHeapBuffer )
  • UTF8/UCS2 /
  • ( CfgValue /bool )
  • ​​int
  • / /
  • ini
  • , , r/w-locks, ( boost )
  • " " (, , , , , , , , ..)
+2

.

- , , ++, - . RAII , ScopeGuard.

A factory ? ? , .

, any_iterator.:)

, ++, - , . - - , , ( , , )

, ", , ", , , "", , , "

+2

. .

0
source
0
source

logging class (which also works in Gui)

0
source

An encryption library or two wrapped in a nice interface.

Hashing algorithms can also be very useful.

0
source

Source: https://habr.com/ru/post/1761354/


All Articles