vendredi 28 octobre 2016

How to implement std::forward_list::front

I am trying to implement std::forward_list, but I'm having trouble implementing front().

I tried doing this:

Object & front( ) {
    return header->next;
}

const Object & front( ) const;

but I'm getting an error non-const lvalue reference to type 'int' cannot bind to a value of unrelated type.

Aucun commentaire:

Enregistrer un commentaire