Condividi tramite


Errore del compilatore C3551

se viene utilizzato un tipo restituito finale, il tipo restituito iniziale deve essere l'identificatore di tipo singolo 'auto' (non 'type')

Osservazioni:

Il tipo restituito iniziale nella sintassi del tipo restituito finale deve contenere solo auto.

Example

L'esempio seguente genera l'errore C3551:

// C3551.cpp
// compile with: /c
const auto func1() -> const int;   // C3551
auto* func2() -> int*;   // C3551
auto& func3() -> int&;   // C3551
auto&& func4() -> int&&;   // C3551
decltype(auto) func5() -> int;   // C3551

auto func6() -> int;   // OK