|
-
August 13th, 2008, 01:12 PM
#1
Readonly Objects returned from methods?
Hi
let's assume i have the following function
void Person getPerson(int ID)
{
Person p= ....
return p;
}
Is it possible to get the Person as an readonly (in C++ const) object from this function without cloning the Person-object? In C++ i would return a const object and therefore only can read public members or call other const-methods of this object. How could i do this with C# ??
Thanks for reading!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|