Why this does not compile?

  • Thread starter Thread starter Pavel A
  • Start date Start date
P

Pavel A

Guest
Just installed the latest VS 2017 community, v. 15.9.7 and compiling slightly changed hello world program...



#include "pch.h"
#include <iostream>

int main()
{
std::string aaa;
std::cout << "Hello World!\n" << aaa;
}


Guess what? It fails with error:

error C2679: binary '<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

It is not my local corruption - same error occurs on Rextester.

-- pa

Continue reading...
 
Back
Top