No, it won't have exactly the same semantics. The C# code you showed would have the same semantics as passing a pointer by value in C++, rather than passing a value by reference. You can pass a parameter by reference in C# using ref
or out
, but you cannot pass a read only reference; such references will always be mutable, thus there is no way of providing identical semantics to that C++ code in C#. That said, while the semantics aren't identical, that should probably be a class (having value types is quite rare in C#) and it should probably be passed by value, it's again rare to need otherwise, just realize that it won't have exactly the same semantics.