It looks that Compteur::Val() is not a const member function.
A const member function has a const suffix and "promises" not to change member data.
When you pass an object by a const reference, you can only call const member functions.
class Example
{
public:
// non-const member function
void func1()
{
}
// const member function
void func2() const
{
}
unsignedint Val() const
{
// ...
}
};