Sündmused
17. märts, 21 - 21. märts, 10
Liituge sarjaga, et luua muude arendajate ja ekspertidega skaleeritavad tehisintellektilahendused, mis põhinevad reaalajas kasutusjuhtumitel.
Registreeruge koheSeda brauserit enam ei toetata.
Uusimate funktsioonide, turbevärskenduste ja tehnilise toe kasutamiseks võtke kasutusele Microsoft Edge.
'identifier': a reference to a volatile field will not be treated as volatile
A volatile field should not normally be passed using a ref
or out parameter, since it will not be treated as volatile within the scope of the function. There are exceptions to this, such as when calling an interlocked API. As with any warning, you may use the #pragma warning to disable this warning in those rare cases where you are intentionally using a volatile field as a reference parameter.
The following sample generates CS0420:
// CS0420.cs
// compile with: /W:1
using System;
class TestClass
{
private volatile int i;
public void TestVolatile(ref int ii)
{
}
public static void Main()
{
TestClass x = new TestClass();
x.TestVolatile(ref x.i); // CS0420
}
}
Toote „.NET“ tagasiside
.NET on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link:
Sündmused
17. märts, 21 - 21. märts, 10
Liituge sarjaga, et luua muude arendajate ja ekspertidega skaleeritavad tehisintellektilahendused, mis põhinevad reaalajas kasutusjuhtumitel.
Registreeruge kohe