> I'm trying to fill a map (the STL associative array) with a set of values.
> In the normal nomenclature, I could initialize an array something like this:
[quoted text clipped - 10 lines]
>
> Lee Crabtree
Alright, boost::assign seems to be what I'm looking for, but when I use
map_list_of, I get an error that I can't seem to find any info on:
error C2440: 'initializing' : cannot convert from
'boost::assign_detail::generic_list<T>' to 'std::map<_Kty,_Ty,_Pr,_Alloc>'
with
[
T=std::pair<boost::assign_detail::assign_decay<int>::type,boost::assign_detail::assign_decay<int>::type>
]
and
[
_Kty=int,
_Ty=int,
_Pr=std::less<int>,
_Alloc=std::allocator<std::pair<const int,int>>
]
The line that causes this error is:
map<int,int> blarg = map_list_of(1, 2);
This library definitely looks like what I'm looking for, but this error is
really weirding me out. Thanks for the suggestion, and if you know how to
fix this error, I would be forever in your debt.
Lee
> The closest thing that comes to that is this:
> http://boost.org/libs/assign/doc/index.html
[quoted text clipped - 18 lines]
>>
>> Lee Crabtree
Carl Daniel [VC++ MVP] - 19 Sep 2005 21:44 GMT
> Alright, boost::assign seems to be what I'm looking for, but when I use
> map_list_of, I get an error that I can't seem to find any info on:
>
> error C2440: 'initializing' : cannot convert from
> 'boost::assign_detail::generic_list<T>' to 'std::map<_Kty,_Ty,_Pr,_Alloc>'
I'd suggest posting to the boost users mailing list. See www.boost.org for
subscription information.
-cd