Is it possible to make an noncopyable type in C# -


is somehow possible in c# create class can not copied around rather can passed around reference?

the equivalent in c++ delete copy-constructor , copy-assignment operator.

it default behavior. if have class:

class foo {     public string bar { get; set; } } 

and somewhere this:

foo f1 = new foo(); foo f2 = f1; 

both f1 , f2 reference same instance. if you, example, set f1.bar = "bar", value read f2.bar "bar".


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

c - getting error: cannot take the address of an rvalue of type 'int' -

How to merge four videos on one screen with ffmpeg -