Простые типы / Boolean

#include <iostream>
#include <sstream>
using namespace std;

string str1 = "true";
bool boolValue1;
istringstream(str1) >> boolalpha >> boolValue1;
//boolValue1 is 1

string str2 = "false";
bool boolValue2;
istringstream(str2) >> boolalpha >> boolValue2;
//boolValue2 is 0

cout << "boolValue1 is " << boolValue1 << endl;
cout << "boolValue2 is " << boolValue2;