Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2003-04-23 10:46:13


John Harris <john.harris_at_[hidden]> wrote:
> Ben Hutchings wrote:
> > I compiled almost the exact same code:
> >
> > #include <boost/pool/pool_alloc.hpp>
> > #include <map>
> > #include <utility>
> >
> > typedef std::basic_string<char, std::char_traits<char>,
> > boost::pool_allocator<char> > t;
> >
> > int main()
> > {
> > std::map<t, t, std::less<t>,
> > boost::pool_allocator<std::pair<const t, t> > > m;
> > }
> >
> > with VC++ 7.0 and Boost 1.29, and got no warnings or errors at all.
> >
>
> Ah, yes, that works for me, too (no warning, either), but try adding
> a line of code that actually uses the map, like this:
>
> m["abc"] = "def";
>
> and you get the following cascade of errors:
<snip>

Which all indicates that operator< is not defined for t, because we
didn't include <string>.

Let's not be so quick to blame the compiler. VC++ 7 is a long way
ahead of version 6.


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