Hello,
how can I pass generic list to a function? Example below does NOT work properly.
15 public
ref class A
16 {
17 public:
19
20 A{}
21 {
22 }
23 ~A{}
24 {
25 }
26
27 private: System::Void use( System::Collections::Generic::List^ list ){
28
29
// working with generic list "genericList" from class B
30
31 }//
32
33 };
// public ref class A
34
35 public
ref class B
36 {
37 public:
38 List<Object^>^ genericList;
39
40 B{}
41 {
42 genericList =
gcnew List<Object^>();
43 }
44 ~B{}
45 {
46
delete( genericList );
47 }
48
49 private: System::Void button1_Click(){
50
51 genericList->Add( ... );
52
53 A a =
gcnew A();
54 A->use( genericList ); // ERROR C2664
55
56
delete( a )
57
58 }//
59
60 };
// public ref class B
many thanks.