styleguide icon indicating copy to clipboard operation
styleguide copied to clipboard

Mention base::NoDestructor<> as workaround for "trivially destructible"

Open aleventhal opened this issue 4 years ago • 0 comments

In the "Static and global variables" section, can we mention that a workaround for using only objects that are trivially destructible is to use base::NoDestructor<>

For example, if you want to use a map in a static global, you can wrap it in that.

https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

aleventhal avatar Nov 18 '20 18:11 aleventhal