नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'identifier': the type for 'type' can only be deduced from a single initializer expression
Remarks
The compiler can only deduce the type for auto or decltype(auto) if the declaration uses direct list-initialization and the initializer-list has a single element.
Example
The following example shows some declarations that cause C2080:
auto x1(1, 2); // C2080
auto x2({4}); // C2080
decltype(auto) x3(1, 2); // C2080
decltype(auto) x4({4}); // C2080
To resolve the issue, use a single value initializer:
auto x1 = 1; // Valid
auto x2(1); // Valid
decltype(auto) x3 = 1; // Valid
decltype(auto) x4(1); // Valid