Understanding a csproj assembly reference

Which reference-type you get depends on how you link the assembly. select the referenced assembly in the project-explorer go to the properties-page there you find a boolean flag “specific Version” true means: the assembly must have version=xxx false means: ignore the assembly version (I only have a german-vs2010 so the english translation for the german … Read more

Why do some people prefer “T const&” over “const T&”?

I think some people simply prefer to read the declarations from right to left. const applies to the left-hand token, except when there is nothing there and it applies on the right-hand token. Hence const T& involves the “except”-clause and can perhaps be thought more complicated (in reality both should be as easy to understand). … Read more

Func delegate with ref variable

It cannot be done by Func but you can define a custom delegate for it: public delegate object MethodNameDelegate(ref float y); Usage example: public object MethodWithRefFloat(ref float y) { return null; } public void MethodCallThroughDelegate() { MethodNameDelegate myDelegate = MethodWithRefFloat; float y = 0; myDelegate(ref y); }

difference between a pointer and reference parameter?

C++ references are intentionally not specified in the standard to be implemented using pointers. A reference is more like a “synonym” to a variable than a pointer to it. This semantics opens some possible optimizations for the compiler when it’s possible to realize that a pointer would be an overkill in some situations. A few … Read more

How to get javascript object references or reference count?

No, no, no, no; and yes, if you really need to count references you will have to do it manually. JS has no interface to this, GC, or weak references. Whilst you could implement a manual reference-counted object list, it’s questionable whether all the extra overhead (in performance terms but more importantly code complexity) is … Read more

Initialization of a constant reference with a number [duplicate]

A non-const reference cannot point to a literal. You cannot bind a literal to a reference to non-const (because modifying the value of a literal is not an operation that makes sense) and only l-values can be bound to references to non-const. You can however bind a literal to a reference to const. The “const” … Read more