TITLE: Void * implicit type conversions PROBLEM: mg@tyrolia.Princeton.EDU (Michael Golan) Farther, the language designers encourage you to provide a void* type conversion; RESPONSE: peju@alice.att.com (Peter Juhl) Could you post a reference to where the C++ language designer(s) has encouraged people to provide void* type conversions ? I can't find it anywhere among my papers / books. RESPONSE: rmartin@rcmcon.com (Robert Martin), 31 Aug 93 I think the origninal statement was a bit too strong. The void* issue probably comes from iostreams. An iostream has a void* converter so that it can be placed as the expression in a conditional: while (cin >> i) { ... } I think even the author of this idiom is aware of the dangers of too many conversion operators and would not recommend a willy nilly lemmings off the cliff rampage into lots and lots of conversions. However, there are some cases where conversions to void* seem appropriate, where the advantages appear to outweigh the risks. Time will tell if these judgements are correct. As for iostreams, I have yet to encounter an error because of the void* conversion. My favorite iterator convention uses a similar void* conversion so that I can use the following idiom: void f(Set& x) { for (Iterator i(x); i; i++) cout << *i; } The void* operator returns 0 when the iterator has reached the end of the list. [ Be very careful about supplying implicit type conversions. They basically give the compiler license to silently change your code, increasing the chances of causing hard-to-find bugs. -adc ]