Boost logo

Boost Users :

Subject: [Boost-users] Boost.container iterator_traits and flat_map
From: gast128 (gast128_at_[hidden])
Date: 2014-12-21 12:28:58

Hello all,

I have a problem here which boils down to the non-constness of
iterator_traits for const_iterator of flat_map:

void Foo()
    typedef boost::container::flat_map<int, int> Int2IntFmap;

    Int2IntFmap::const_iterator it2;
r2 = it2->first;

error C2440: 'initializing' : cannot convert from 'const int' to 'int &'

Anyone an idea or should I use decltype instead?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at