#include <iostream> #include <vector> using namespace std; int main() { vector<bool> vec({false, false, true, false}); bool *some_bool = &vec[2]; *some_bool = false; return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’:
prog.cpp:8:26: error: taking address of temporary [-fpermissive]
bool *some_bool = &vec[2];
^
prog.cpp:8:26: error: cannot convert ‘std::vector<bool>::reference* {aka std::_Bit_reference*}’ to ‘bool*’ in initialization
Standard output is empty