Note that there are some explanatory texts on larger screens.

plurals
  1. USEser Aygün
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. CO@newacct Good argument! But now you are using pointer references (`Integer *&`). If Java had had pointers you could do the same: `swap(Pointer<Integer> a, Pointer<Integer> b); ...` In fact, you can implement a `Pointer<T>` class easily and achieve the same effect. Again, I cannot see any difference between how C++ and Java handle object references.
      singulars
    2. CO@A.H. `int` is not an object type. You can't pass primitive types by reference in Java. So, in my hypothetical language (Java with ampersands), it would be disallowed to define primitive arguments with `&`. Similarly, it would be disallowed to define object arguments _without_ `&` (as all objects must reside inside the heap). This hypothetical Java syntax would look like C++, work like C++, with the intrinsic restrictions of Java that I listed above. That's what I was trying to demonstrate. I need more space to discuss it further. Maybe I should write an article...
      singulars
    3. CO@A.H. I understand the second point and I agree. On the first point, I was not referring to implementation details but actual effects. _When working with objects_, PBR in C++ has the same effects as PBV (as everybody calls it) in Java. The only difference I can see is the notation. One could easily change the Java syntax and require `&` before reference types. Then how would you explain the difference? (I'm not trying to bug you by the way. Excuse me if I seem obstinate.)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload