Espaços nominais
Variantes
Acções

Diferenças entre edições de "cpp/language/direct initialization"

Da cppreference.com
< cpp‎ | language
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===
{{sdcl list begin}}
+
{{begin}}
{{sdcl list item | num=1 | {{sparam|T}} {{sparam| object}} {{ttb|( }} {{sparam|arg}} {{ttb|);}}
+
{{| num=1 | {{|T}} {{| object}} {{ttb|( }} {{|arg}} {{ttb|);}}
{{sparam|T}} {{sparam| object}} {{ttb|( }} {{sparam|arg1, arg2, ...}} {{ttb|);}}
+
{{|T}} {{| object}} {{ttb|( }} {{|arg1, arg2, ...}} {{ttb|);}}
 
}}
 
}}
{{sdcl list item | num=2 | {{sparam|T}} {{sparam| object}} {{ttb|{ }} {{sparam|arg}} {{ttb|};}}
+
{{| num=2 | {{|T}} {{| object}} {{ttb|{ }} {{|arg}} {{ttb|};}}
{{sparam|T}} {{sparam| object}} {{ttb|{ }} {{sparam|arg1, arg2, ...}} {{ttb|};}}
+
{{|T}} {{| object}} {{ttb|{ }} {{|arg1, arg2, ...}} {{ttb|};}}
 
|notes={{mark since c++11}}}}
 
|notes={{mark since c++11}}}}
{{sdcl list item | num=3 | {{sparam|T}} {{ttb|( }} {{sparam|other}} {{ttb|)}}
+
{{| num=3 | {{|T}} {{ttb|( }} {{|other}} {{ttb|)}}
{{sparam|T}} {{ttb|( }} {{sparam|arg1, arg2, ...}} {{ttb|);}}
+
{{|T}} {{ttb|( }} {{|arg1, arg2, ...}} {{ttb|);}}
 
}}
 
}}
{{sdcl list item | num=4 | {{ttb|static_cast<}} {{sparam|T}} {{ttb|>(}} {{sparam|other}} {{ttb|)}} }}
+
{{| num=4 | {{ttb|static_cast<}} {{|T}} {{ttb|>(}} {{|other}} {{ttb|)}} }}
{{sdcl list item | num=5 | {{ttb|new}} {{sparam|T}}{{ttb|(}}{{sparam|args, ...}}{{ttb|)}} }}
+
{{| num=5 | {{ttb|new}} {{|T}}{{ttb|(}}{{|args, ...}}{{ttb|)}} }}
{{sdcl list item | num=6 | {{sparam|Class}}{{ttb|::}}{{sparam|Class}}{{ttb|() : }}{{sparam|member}}{{ttb|(}}{{sparam|args, ...}}{{ttb|) {...}} }}
+
{{| num=6 | {{|Class}}{{ttb|::}}{{|Class}}{{ttb|() : }}{{|member}}{{ttb|(}}{{|args, ...}}{{ttb|) {...}} }}
{{sdcl list item | num=7 | {{ttb|[}}arg{{ttb|](){...}} | notes={{mark since c++11}}}}
+
{{| num=7 | {{ttb|[}}arg{{ttb|](){...}} | notes={{mark since c++11}}}}
{{sdcl list end}}
+
{{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 {{sparam|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 {{sparam|other}} to the cv-unqualified version of {{tt|T}}.}}
+
* {{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

 
 
Linguagem C++
Tópicos gerais
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Controle de fluxo
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Declarações execução condicional
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Instruções de iteração
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ir declarações
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaração da função
lambda declaração da função
modelo de função
linha especificador
especificações de exceção (obsoleta)
noexcept especificador (C++11)
Exceções
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.