CppPilot

C++ / Ricerca nella documentazione

Trova l'errore. Trova il passo successivo.

Cerca per codice diagnostico, messaggio copiato o sintomo. Filtra per contenuto e sistema di progetto.

  1. Esempi e diagrammiMSBuild + CMake

    C2259: Una funzione virtuale pura non è implementata.

    Implementa ogni funzione virtuale pura delle classi base nella classe derivata.

  2. Esempi e diagrammiMSBuild + CMake

    C2259: La classe base viene creata direttamente.

    Crea la classe derivata e usa un puntatore o un riferimento alla classe base.

  3. Esempi e diagrammiMSBuild + CMake

    C2259: La firma è diversa da quella della classe base.

    A missing const , another parameter type, or another calling convention declares a new function instead of overriding. Write override on each override: the compiler then reports the mismatch directly (C3668).

  4. Esempi e diagrammiMSBuild + CMake

    C2280: Una classe che ne contiene uno viene copiata.

    A class with a unique_ptr member cannot normally be copied. If it has an available move constructor, move it into containers ( push_back(std::move(item)) ), or construct it with emplace_back . A user-declared destructor can prevent an…

  5. Esempi e diagrammiMSBuild + CMake

    C2280: Una lambda che ne possiede uno viene memorizzata in std::function.

    std::function requires a copyable callable: use std::move_only_function in C++23, or a std::shared_ptr .

  6. Esempi e diagrammiMSBuild + CMake

    C2280: Un membro rende impossibile l'assegnazione.

    A const or reference member deletes the copy assignment: assign member by member, or store a pointer.

  7. Esempi e diagrammiMSBuild + CMake

    C2280: Viene copiato un oggetto non copiabile.

    std::unique_ptr , std::thread , and std::mutex cannot be copied: pass them by reference, or transfer movable types with std::move . A std::mutex cannot be moved either; share it by reference.

  8. Esempi e diagrammiMSBuild + CMake

    C2440: Un void* diventa un puntatore tipizzato.

    C++ needs an explicit static_cast , for example on the result of malloc .

  9. Esempi e diagrammiMSBuild + CMake

    C2440: Un puntatore a dati const viene assegnato a un puntatore a dati modificabili.

    Preserve the pointed-to type's const , rather than casting const away.

  10. Esempi e diagrammiMSBuild + CMake

    C2440: Una stringa letterale è assegnata a char* .

    String literals are constant. Since conformance mode ( /permissive- ) is on in new projects, write const char* or use std::string .

  11. Esempi e diagrammiMSBuild + CMake

    C2440: Una enum class viene usata come intero.

    Scoped enumerations do not convert implicitly: use static_cast .

  12. Esempi e diagrammiMSBuild + CMake

    C2440: I tipi non sono correlati.

    Nessun cast rende compatibili in modo sicuro tipi non correlati: controlla di usare la variabile che intendevi.

  13. Esempi e diagrammiMSBuild + CMake

    C2512: Un contenitore crea elementi senza argomenti.

    std::map::operator[] , vector::resize , and arrays need a default constructor: use map.at , try_emplace , or emplace_back instead.

  14. Esempi e diagrammiMSBuild + CMake

    C2512: Un membro o una classe base non ha un costruttore predefinito.

    Initialize it in the member initializer list of every constructor: Line() : start(0, 0), end(0, 0) {} .

  15. Esempi e diagrammiMSBuild + CMake

    C2512: La classe dichiara solo costruttori con parametri.

    Pass the arguments, or add a default constructor: Point() = default; with default member values.

  16. Esempi e diagrammiMSBuild + CMake

    C2664: Un oggetto const viene passato a un parametro non const.

    Make the parameter const , or pass a copy.

  17. Esempi e diagrammiMSBuild + CMake

    C2664: Una stringa stretta viene passata a una funzione Windows Unicode.

    With Character Set set to Unicode, MessageBox is MessageBoxW and expects wide strings: write L"Hello" , call MessageBoxA , or use TEXT("Hello") .

  18. Esempi e diagrammiMSBuild + CMake

    C2664: Un oggetto temporaneo viene passato a un riferimento non const.

    A parameter std::string& does not accept a literal or a temporary: take const std::string& when the function does not change it.

  19. Esempi e diagrammiMSBuild + CMake

    C2664: Gli argomenti sono nell'ordine sbagliato.

    Confronta la chiamata con la dichiarazione riportata nel messaggio; forse intendevi un altro overload.

  20. Esempi e diagrammiMSBuild + CMake

    C3861: La funzione è definita sotto la chiamata.

    Declare it before the call ( int Compute(int); ), in a header or at the top of the file, or move its definition above.