0

CHotel& hotel = *it; I have problem on this row . When i'm trying to compile all code i get error binding of reference to a value of type drops qualifiers.

void addHotel(CHotel & hotel) {
        m_veriga.insert(hotel);         
        multiset<CHotel>::iterator it;


        for (it = m_veriga.begin(); it != m_veriga.end(); ++it)
        {
            CHotel& hotel = *it;
            cout << hotel.getHotelName() << endl;
        }
    }
vlladislav45
  • 63
  • 2
  • 9

1 Answers1

1

Dereferencing the iterator will give you a const CHotel reference in set and multiset. So CHotel const& hotel = *it; will work.

phön
  • 1,215
  • 8
  • 20