◐ Shell
clean mode source ↗

std::generic_category - cppreference.com

Da cppreference.com.

Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.

La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Elemento definito nell'header

<system_error>

const std::error_category& generic_category();

(dal C++11)

Ottiene un riferimento all'oggetto statico categoria di errore per errori generici. L'oggetto è necessario eseguire l'override della funzione virtuale error_category::name() per restituire un puntatore alla stringa "generic". Esso è utilizzato per identificare le condizioni di errore che corrispondono ai codici errno POSIX.

Original:

Obtains a reference to the static error category object for generic errors. The object is required to override the virtual function error_category::name() to return a pointer to the string "generic". It is used to identify error conditions that correspond to the POSIX errno codes.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parametri

(Nessuno)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valore di ritorno

Un riferimento all'oggetto statico del tipo di runtime non specificato, derivato da std::error_category.

Original:

A reference to the static object of unspecified runtime type, derived from std::error_category.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Eccezioni

Esempio

#include <iostream>
#include <system_error>
#include <cerrno>
#include <string>
int main()
{
    std::error_condition econd = std::generic_category().default_error_condition(EDOM);
    std::cout << "Category: " << econd.category().name() << '\n'
              << "Value: " << econd.value() << '\n'
              << "Message: " << econd.message() << '\n';
}

Output:

Category: generic
Value: 33
Message: Numerical argument out of domain

Vedi anche

identifica la categoria di errore del sistema operativo

Original:

identifies the operating system error category

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(funzione) [modifica]

l'enumerazione std::error_condition elenco di tutti gli standard <cerrno> costanti macro

Original:

the std::error_condition enumeration listing all standard <cerrno> macro constants

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe) [modifica]