Boost logo

Boost :

Subject: Re: [boost] [container] [flat_map] Error with heterogeneous comparator and std::string_view
From: Viktor Sehr (viktor.sehr_at_[hidden])
Date: 2018-08-12 21:39:55


Hi,
I'm using 1.68 release. Back in 1.67 heterogeneous lookup was not
implemented, now in 1.68.0 it is implemented but fails to compile with
std::string as key and std::string_view key for lookup in MSVC.

/Viktor

On Sun, Aug 12, 2018 at 7:09 PM Andrey Semashev via Boost <
boost_at_[hidden]> wrote:

> On 08/12/18 19:26, Viktor Sehr via Boost wrote:
> > On MSVC (latest) the following code yields a compile error with flat_map,
> > but not with std::map. I do not have the knowledge of std::less<> to
> > resolve what causes the error.
> >
> > auto fm = boost::container::flat_map<std::string, int, std::less<> >{};
> > auto m = std::map<std::string, int, std::less<> >{};
> > auto k = std::string_view{ "my_key" };
> > auto x = m.find(k); // Compiles
> > auto y = fm.find(k); // Does NOT compile
>
> Looks like this is the same problem that you asked before:
>
>
> http://boost.2283326.n4.nabble.com/container-flat-map-Sub-optimal-behavior-when-utilized-with-std-less-lt-gt-tt4703418.html
>
> What Boost version are you using?
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk