Rick Gutleber wrote:
>
> Can you explain why this is so?
MySQL++ knows when the left hand side of operator<< is a Query, as
opposed to any other C++ IOstream, doing quoting and escaping only in
that case. You wouldn't want this:
cout << String("foo") << endl;
to produce this:
"foo"
ostringstream is similarly generic. MySQL++ doesn't know that you're
going to use the buffer for SQL queries, so it doesn't quote and escape
strings.
If you're asking how MySQL++ knows, search for dynamic_cast in
lib/manip.cpp. (And other places.)