От: | Constructor | ||
Дата: | 25.08.14 12:00 | ||
Оценка: | 6 (1) |
decltype(foo(t), void(), true)
decltype((void)foo(t), true)
decltype(static_cast<void>(foo(t)), true)
[class.conv.fct] 12.3.2/1
A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) base class of that type (or a reference to it), or to (possibly cv-qualified) void.
These conversions are considered as standard conversions for the purposes of overload resolution (13.3.3.1, 13.3.3.1.4) and therefore initialization (8.5) and explicit casts (5.2.9). A conversion to void does not invoke any conversion function (5.2.9). Even though never directly called to perform a conversion, such conversion functions can be declared and can potentially be reached through a call to a virtual conversion function in a base class.