Liste des Groupes | Revenir à cl c++ |
On Mon, 31 Mar 2025 15:39:53 +0300The constructor of the object is not guaranteed to run if the object nor anything else in its TU is not accessed from outside. It means the socket might not be opened.
Paavo Helde <eesnimi@osa.pri.ee> wibbled:On 31.03.2025 12:09, Muttley@DastardlyHQ.org wrote:Who writes this stuff? Its borderline gibberish.
"If [initialization] is deferred, it strongly happens before any
non-initialization odr-use of any non-inline function or non-inline
variable defined in the same translation unit as the variable to be
initialized."
The keyword here is "non-initialization use". If you access your myobjNot necessarily. What it the constructor of one object opened a network
from main() it would be a non-initialization use, which is guaranteed to trigger the needed initialization if needed, so everything will work fine.
socket but that object wasn't touched again until something else in the
program tried to loop back to that socket?
Les messages affichés proviennent d'usenet.