C++ Primer 4/e在Conversions and Class Types這個地方有一個警告：『As with using overloaded operators, judicious use of conversion operators can greatly simplify the job of a class designer and make using a class easier. However, there are two potential pitfalls: Defining too many conversion operators can lead to ambiguous code, and some conversions can be confusing rather than helpful.
The best way to avoid ambiguities is to ensure that there is at most one way to convert one type to another. The best way to do that is to limit the number of conversion operators. In particular there should be only one conversion to a built-in type.
Conversion operators can be misleading when they are used where there is no obvious single mapping between the class type and the conversion type. In such cases, providing a conversion function may be confusing to the user of the class.
As an example, if we had a class that represented a Date, we might think it would be a good idea to provide a conversion from Date to int. However, what value should the conversion function return? The function might return the julian date, which is the sequence number of the current date starting from 0 as January 1. But should the year precede the day or follow it? That is, would January 31, 1986 be represented as 1986031 or 311986? Alternatively, the conversion operator might return an int representing the day count since some epoch point. The counter might count days since January 1, 1971 or some other starting point.
The problem is that whatever choice is made, the use of Date objects will be ambiguous because there is no single one-to-one mapping between an object of type Date and a value of type int. In such cases, it is better not to define the conversion operator. Instead, the class ought to define one or more ordinary members to extract the information in these various forms.』
舉個例子，如果我們有個Date class，我們可能認為提供「從Date到int」的轉換是不錯的主意。然而這個函式應該返回什麼值呢？它可以返回所謂julian date，那是將月份從0起算的當前日期序號。但年應該在日之前或之後呢？也就是說1986年1月31日應該記為1986031還是311986？另一個方式是返回int，代表從某個紀元起算的日期序號，也許是從1971年1月1日或其他起點起算。
I finally decided to write a comment on your blog. I just wanted to say good job. I really enjoy reading your posts.