नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : cannot provide arguments when creating an instance of a generic parameter
Remarks
When you specify the gcnew() constraint, you specify that the constraint type will have a parameterless constructor. Therefore, it is an error to attempt to instantiate that type and pass a parameter.
See Constraints on Generic Type Parameters (C++/CLI) for more information.
Example
The following example generates C3399.
// C3399.cpp
// compile with: /clr /c
generic <class T>
where T : gcnew()
void f() {
T t = gcnew T(1); // C3399
T t2 = gcnew T(); // OK
}