Diferenças entre edições de "cpp/language/direct initialization"
Da cppreference.com
m (r2.7.3) (Robô: A adicionar: de, en, es, fr, it, ja, ru, zh) |
m (Use {{lc}}. Update links. Various fixes.) |
||
Linha 5: | Linha 5: | ||
===Sintaxe=== | ===Sintaxe=== | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| num=1 | {{|T}} {{| object}} {{ttb|( }} {{|arg}} {{ttb|);}} |
− | {{ | + | {{|T}} {{| object}} {{ttb|( }} {{|arg1, arg2, ...}} {{ttb|);}} |
}} | }} | ||
− | {{ | + | {{| num=2 | {{|T}} {{| object}} {{ttb|{ }} {{|arg}} {{ttb|};}} |
− | {{ | + | {{|T}} {{| object}} {{ttb|{ }} {{|arg1, arg2, ...}} {{ttb|};}} |
|notes={{mark since c++11}}}} | |notes={{mark since c++11}}}} | ||
− | {{ | + | {{| num=3 | {{|T}} {{ttb|( }} {{|other}} {{ttb|)}} |
− | {{ | + | {{|T}} {{ttb|( }} {{|arg1, arg2, ...}} {{ttb|);}} |
}} | }} | ||
− | {{ | + | {{| num=4 | {{ttb|static_cast<}} {{|T}} {{ttb|>(}} {{|other}} {{ttb|)}} }} |
− | {{ | + | {{| num=5 | {{ttb|new}} {{|T}}{{ttb|(}}{{|args, ...}}{{ttb|)}} }} |
− | {{ | + | {{| num=6 | {{|Class}}{{ttb|::}}{{|Class}}{{ttb|() : }}{{|member}}{{ttb|(}}{{|args, ...}}{{ttb|) {...}} }} |
− | {{ | + | {{| num=7 | {{ttb|[}}arg{{ttb|](){...}} | notes={{mark since c++11}}}} |
− | {{ | + | {{end}} |
===Explicação=== | ===Explicação=== | ||
Linha 35: | Linha 35: | ||
* {{tr|Se {{tt|T}} é um tipo de classe, os construtores de {{tt|T}} são examinados ea melhor combinação é selecionada por resolução de sobrecarga. O construtor é então chamado para inicializar o objeto.|If {{tt|T}} is a class type, the constructors of {{tt|T}} are examined and the best match is selected by overload resolution. The constructor is then called to initialize the object.}} | * {{tr|Se {{tt|T}} é um tipo de classe, os construtores de {{tt|T}} são examinados ea melhor combinação é selecionada por resolução de sobrecarga. O construtor é então chamado para inicializar o objeto.|If {{tt|T}} is a class type, the constructors of {{tt|T}} are examined and the best match is selected by overload resolution. The constructor is then called to initialize the object.}} | ||
− | * {{tr|Caso contrário, se {{tt|T}} é um tipo não-classe, [[cpp/language/implicit_cast|conversões standard]] são utilizadas, se necessário, para converter o valor de {{ | + | * {{tr|Caso contrário, se {{tt|T}} é um tipo não-classe, [[cpp/language/implicit_cast|conversões standard]] são utilizadas, se necessário, para converter o valor de {{|other}} à versão não qualificado de cv-{{tt|T}}.|Otherwise, if {{tt|T}} is a non-class type, [[cpp/language/implicit_cast|conversões standard]] are used, if necessary, to convert the value of {{|other}} to the cv-unqualified version of {{tt|T}}.}} |
===Notas=== | ===Notas=== |
Edição actual desde as 09h34min de 2 de julho de 2013
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |