prog.cpp:17:14: error: non-const lvalue reference to type 'std::_Bit_reference' cannot bind to a temporary of type 'reference' (aka 'std::_Bit_reference')
for (auto & val : vec) { // Сасай-кудасай для vector<bool>, ОК для остальных
^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:779:5: note: selected 'begin' function with iterator type 'iterator' (aka 'std::_Bit_iterator')
begin() _GLIBCXX_NOEXCEPT
^
prog.cpp:21:26: error: taking the address of a temporary object of type 'reference' (aka 'std::_Bit_reference') [-Waddress-of-temporary]
bool *firstValPointer = &vec[0]; // Сасай-кудасай для vector<bool>, ОК для остальных
^~~~~~~
prog.cpp:21:8: error: cannot initialize a variable of type 'bool *' with an rvalue of type 'reference *' (aka 'std::_Bit_reference *')
bool *firstValPointer = &vec[0]; // Сасай-кудасай для vector<bool>, ОК для остальных
^ ~~~~~~~
prog.cpp:23:2: error: no matching function for call to 'flipBool'
flipBool(vec[0]); // Сасай-кудасай.
^~~~~~~~
prog.cpp:8:6: note: candidate function not viable: no known conversion from 'reference' (aka 'std::_Bit_reference') to 'bool &' for 1st argument
void flipBool(bool & val)
^
4 errors generated.