C++ question: literal form of std::map<int, std::array>

Naruhiko Ogasawara naruoga at gmail.com
Sat May 16 11:24:21 UTC 2020


2020年5月15日(金) 15:36 Stephan Bergmann <sbergman at redhat.com>:
>
> On 14/05/2020 20:59, Naruhiko Ogasawara wrote:
> > 2020年5月14日(木) 22:37 Stephan Bergmann <sbergman at redhat.com>:
> >> On 14/05/2020 12:40, Naruhiko Ogasawara wrote:
> >>> --------------------------
> >>> static const std::map<LanguageType, std::array<sal_uInt8, 4>> tblDBNumToNatNum
> >>>       = { { primary(LANGUAGE_CHINESE),    { 4, 5, 6, 0 } },
> >>>           { primary(LANGUAGE_JAPANESE),   { 4, 5, 3, 0 } },
> >>>           { primary(LANGUAGE_KOREAN),     { 1, 2, 3, 9 } } };
> >>> --------------------------
> >>>
> >>> The compiler claimed:
> >>> --------------------------
> >>> Error (active) E0289 no instance of constructor "std::map<_Kty, _Ty,
> >>> _Pr, _Alloc>::map [with _Kty=LanguageType, _Ty=std::array<sal_uInt8,
> >>> 4U>, _Pr=std::less<LanguageType>,
> >>> _Alloc=std::allocator<std::pair<const LanguageType,
> >>> std::array<sal_uInt8, 4U>>>]" matches the argument list
> >>> --------------------------
> >>
> >> There should be no reason that that does not work.  Probably an issue
> >> with whatever specific compiler you are using?
> >>
> >
> > I'm not sure but I'm using latest LODE in Windows 10, with Visual Studio
> > Community 2019 V16.5.5, with MSVC v142 + Clang 9.0.0.
> > And my build has branched from master:
> > 0b81aaa36b5b78e208c5cc2cd36b4906b8d636a6
>
> Works fine for me with VS 2019 16.5.4.  Maybe you should upload your
> full change to Gerrit.
>

Not sure this is a right way to do, anyway I uploaded my commit into Gerrit
as work in progress:

https://gerrit.libreoffice.org/c/core/+/94354

The last commit there breaks my build...

I am guessing that this issue is coming from my environment, so I tried
to re-install my VS2019 community, but no lack for now.


Best regards,
-- 
Naruhiko NARU Ogasawara (naruoga at gmail.com)


More information about the LibreOffice mailing list