I'm a Java programmer who has been trying to learn a bit of C++ on the side to expand on my knowledge. Here is a small code snippet which I think works due to implicit conversion but I'd like to know which part of the specification does it refer to and what are the other rules which I must be aware of when it comes to implicit conversion. Is there a document/link/site out there which lays down the implicit conversion rules?
#include <vector>
#include <iostream>
#include <iterator>
int main(void) {
using namespace std;
vector<bool> a;
a.push_back("asdf");
a.push_back("");
a.push_back(12);
a.push_back(0.0);
copy(a.begin(), a.end(), ostream_iterator<bool>(cout, "\n"));
return 0;
}
/*
output:
1
1
1
0
*/
TIA,
sasuke