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

Stephan Bergmann sbergman at redhat.com
Thu May 14 13:36:56 UTC 2020


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?



More information about the LibreOffice mailing list