Compiler Error C3255
'value type' : cannot dynamically allocate this value type object on native heap
Instances of a value type (see Classes and Structs) that contain managed members can be created on the stack but not on the heap.
The following sample generates C3255:
// C3255.cpp
// compile with: /clr
using namespace System;
value struct V {
Object^ o;
};
value struct V2 {
int i;
};
int main() {
V* pv = new V; // C3255
V2* pv2 = new V2;
V v2;
}
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre