tag:blogger.com,1999:blog-264654303037912405.post5228095485839837423..comments2024-03-15T13:19:45.701+02:00Comments on Hungry Mind: if block and variable declarationAnonymoushttp://www.blogger.com/profile/14003906116514303118noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-264654303037912405.post-76640384468821968812008-11-11T17:08:00.000+02:002008-11-11T17:08:00.000+02:00Все это понятно:8.5 InitializersIf the initializat...Все это понятно:<BR/>8.5 Initializers<BR/><BR/>If the initialization is direct-initialization, or if it is copy-initialization where the cv-unqualified version<BR/>of the source type is the same class as, or a derived class of, the class of the destination, constructors<BR/>are considered. The applicable constructors are enumerated (13.3.1.3), and the best one is<BR/>chosen through overload resolution (13.3). The constructor so selected is called to initialize the<BR/>object, with the initializer expression(s) as its argument(s). If no constructor applies, or the overload<BR/>resolution is ambiguous, the initialization is ill-formed.<BR/><BR/>Подозреваю, что может быть непонятка из-за того, что SomeType st(...) - декларация функции.Anonymoushttps://www.blogger.com/profile/14003906116514303118noreply@blogger.comtag:blogger.com,1999:blog-264654303037912405.post-44186465390171225932008-11-11T01:14:00.000+02:002008-11-11T01:14:00.000+02:00Что интересно, в первом случае реально вызова oper...Что интересно, в первом случае реально вызова operator= может и не происходить. К bool-у приводится уже сам объект st а не результат operator= для типа SomeType.<BR/><BR/>Т.е. и в первом и во втором случае инициализации были бы эквивалентны.Anonymousnoreply@blogger.com