fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<bool> vec({false, false, true, false});
  7.  
  8. bool *some_bool = &vec[2];
  9. *some_bool = false;
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty