google / google/styleguide

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

Open
#601 0 comments 0 reactions 0 assignees View on GitHub
lang:cpp
Dominant language
HTML
Stars
39.6k
Forks
12.9k
Avg merge
42m
Merged PRs (30d)
15

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.