std::declare_reachable
Da cppreference.com
![]() | 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. |
Definido no cabeçalho <memory> | ||
void declare_reachable(void* p ) | (desde C++11) | |
Declara o objeto referenciado pela alcançável
p
ponteiro. Objetos acessíveis não será excluído pelo coletor de lixo ou considerados um vazamento por um detector de vazamento, mesmo se todos os ponteiros para que sejam destruídos. Um objeto pode ser declarado acessado várias vezes, caso em que várias chamadas para std::undeclare_reachable seriam necessários para remover esta propriedade. Por exemplo, um XOR lista ligada precisa declarar seus nós alcançável se a implementação tem coleta de lixo habilitado.Original:
Declares the object referenced by the pointer
p
reachable. Reachable objects will not be deleted by the garbage collector or considered to be a leak by a leak detector even if all pointers to it are destroyed. An object may be declared reachable multiple times, in which case multiple calls to std::undeclare_reachable would be needed to remove this property. For example, a XOR lista ligada needs to declare its nodes reachable if the implementation has garbage collection enabled.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Índice |
[editar]Parâmetros
p | - | um ponteiro com segurança derivada ou um ponteiro nulo Original: a safely-derived pointer or a null pointer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar]Valor de retorno
(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar]Exceções
Pode lançar std::bad_alloc se o sistema não pode alocar memória necessária para rastrear objetos acessíveis.
Original:
May throw std::bad_alloc if the system cannot allocate memory required to track reachable objects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar]Exemplo
Esta seção está incompleta Motivo: sem exemplo |
[editar]Veja também
(C++11) | declara que um objeto pode ser reciclado Original: declares that an object can be recycled The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |