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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -