I was doing some problem in which I required to reset values in a vector of bool after some searching I found out that memset() is faster than fill() so I tried to use it like this:
vector<bool>vis(500, false);
//Some code
memset(&vis[0], false, sizeof(bool)*500);
but this is giving me compilation error:
error: taking address of rvalue [-fpermissive]
and doing this does not gives any error:
vector<int>vis(500, 0);
//Some code
memset(&vis[0], 0, sizeof(int)*500);
I don't understand this behaviour.