• [^] # Re: Initialisation des variables

    Posté par . En réponse à la dépêche C++ se court-circuite le constructeur de copie. Évalué à 2.

    Lequel ?

    Pour l'initialisation des variables « non locale »:

    [§3.7.2]
    Variables with static storage duration (3.7.1) or thread storage duration (3.7.2) shall be
    zero-initialized (8.5) before any other initialization takes place.

    Pour l'initialisation par une liste, c'est plus touffu:

    [§8.5]
    To zero-initialize an object or reference of type Tmeans:
    —if T is an array type, each element is zero-initialized;
    [§8.5.1 Aggregates]
    [§8.5.4]
    if the initializer list has no elements and T is an aggregate, each of the members of T is initialized
    from an empty initializer list.


    La norme que j'ai lue se trouve sur openstd