ambigous conversion for autoPtr<bool>
The autoPtr
currently has different casting types. Eg,
explicit operator bool() const noexcept;
operator const T&() const;
Consider the following:
autoPtr<bool> something;
if (something) ...
This may either imply that the operator bool
is invoked (testing for existence of the pointer), or the operator const T&
is invoked (returning the value of the pointer).
The casting to type is not particularly desirable, but still supported with #define Foam_autoPtr_castOperator
in order to handle legacy code.
Current best fix is to replace with Switch
.
Edited by Mark OLESEN