Boost logo

Boost Users :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-02-24 14:19:31


"Josue Gomes" <josue_at_[hidden]> wrote in message
news:cvkdik$qjk$1_at_sea.gmane.org...
| Hi,
|
|
| Take this code:

[snip]

| It compiles fine with VC 7.1. However g++ 3.3 and 3.4
| (both on Linux) refuse to compile it.
|
| See the error message (excerpt):
|
| sample.cpp:36: instantiated from here
| /usr/include/c++/3.4/bits/stl_pair.h:90: error: call of overloaded
| `map(const boost::assign_detail::generic_list<std::pair<const char*,
| boost::assign_detail::generic_list<std::pair<const char*, long unsigned
| int> > > >&)' is ambiguous
| /usr/include/c++/3.4/bits/stl_map.h:166: note: candidates are:

| Any ideas of what is going on here?

it seems that several map constructors together with a implicit convertion
operator
creates an ambiguity.

I must admit a deeper look might be necessary. Until then, I would try to use
insert( my_map ) to remove the outer most call to map_list_of().
Secondly, using list_of<my_typedef> can also have a positive effect.

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net