New issue
Advanced search Search tips

Issue 889564 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Perfect forwarding from NoDestructor to flat_map isn't

Project Member Reported by thakis@chromium.org, Sep 26

Issue description

I had to change

static const base::flat_map<std::string, MimeUtil::Codec> kStringToCodecMap({
  ...entries...
});

to

static const base::NoDestructor<base::flat_map<std::string, MimeUtil::Codec>> kStringToCodecMap(base::flat_map<std::string, MimeUtil::Codec>({
  ...entries...
}));

when making it NoDestructor.

Note the additional base::flat_map<std::string, MimeUtil::Codec>() ctor call.

Isn't perfect forwarding supposed to not require this? Or does that only work with uniform initialization?

Context:

https://chromium-review.googlesource.com/c/chromium/src/+/1246602/6/media/base/mime_util_internal.cc
 

Sign in to add a comment