Skip to main content
Filter by
Sorted by
Tagged with
4 votes
1 answer
116 views

Consider this code: struct Struct { public int Num; } class Program { public void A(ref readonly Struct s) { } public void B(ref readonly Struct s) => A(ref s); } I get a compilation ...
Yaakov Shoham's user avatar
0 votes
1 answer
40 views

Extension methods operate on an instance of a class, but they are implemented as static methods inside a static class. It seems that they don't allow declaring any variables static or readonly. Here ...
Rudiger W.'s user avatar
1 vote
2 answers
164 views

I want to make a macro that when given a type T, will return a pointer type that is readonly when passed to a function, like so: void foo( readonly_ptr(char) str ) { // can only read from str, not ...
Abdulmalek Almkainzi's user avatar
0 votes
0 answers
189 views

(Possibly this is the same question as Function local read-only vs. global read-only variable with the same name) In a script I wrote I'm using readonly key="$1" (for the program parameter) ...
U. Windl's user avatar
  • 4,738
0 votes
0 answers
386 views

I'm getting error when i try to extract toolbarStyles from here and create a read-only computed property. private func toolbarButtons(toolbar: Toolbar) { guard let selection = getSelection() else ...
userNew's user avatar
  • 11
-1 votes
3 answers
485 views

It seems similar to write: use Const::Fast; const $xx, 77; sub test { do_something_with( $xx ); } or sub test { state $xx = 77; do_something_with( $xx ); } What is the better ...
Eugen Konkov's user avatar
0 votes
2 answers
322 views

How can we check under if whether a variable is readonly or not? Please Explain with Examples
Aditya Purusharthi's user avatar
1 vote
2 answers
1k views

I have this jagged array in C#: private static readonly float[][] Numbers = { new float[]{ 0.3f, 0.4f, 0.5}}; How can I override the value? public static void SetNewNumbers(float[][] num){ ...
DD995's user avatar
  • 11
3 votes
1 answer
288 views

The only help I've found on the internet so far is this blog. Which I thought was going to get me there, but I don't think it's actually changing the values in my module. I made a sample to show what ...
Eric Fossum's user avatar
  • 2,492
2 votes
1 answer
525 views

I was trying to understand how the constants $TRUE, $FALSE and $NULL work in Powershell, and how I should test for them or compare them with variables, respectively. Being a Powershell newbie, I did ...
Binarus's user avatar
  • 4,537