Probably it's cause i didn't sleep all the night...but can someone explain me why the first operator[] (the const one) generates a warning in MSVC 2010 saying that i'm returning the address of a temorary variable, and the second operator[] (the non-const one) produces a compiler error stating: 'return' : cannot convert from 'std::_Vb_reference<_Alloc>' to 'bool &' ?!?!?
Thanks a lot to everyone will waste time on my question.
class ReqAtts
{
public:
const bool& operator[](size_t ii) const
{
return _atts[ii];
}
bool& operator[](size_t ii)
{
return _atts[ii];
}
private:
std::vector<bool> _atts;
};