As soon as I read in a statement that
A language function that "closed a deal" to enable link operator overloading.
Why are links necessary to effectively support operator overloading? Any good explanation?
Here is what Straustrup said in "Project and Evolution of C ++" (3.7 "links"):
Links were provided mainly to support operator overloading ....C , , . , . , , . : a = b - c; ( ) , a = &b - &c; . , &b - &c C, .
Links were provided mainly to support operator overloading ....
C , , . , . , , . :
a = b - c;
( ) ,
a = &b - &c;
. , &b - &c C, .
&b - &c
" → " . , , , . , - . , - .
, (, ).
: , , x @y ( "@" ) x.opertor@(y). , , - x , : , - , x+2 - x, , , . , () , , . x=y - , , , , .
x.opertor@(y)
x
x+2
x=y
, " " 90% , ...
, , . , ; , .. , , ++, . , . ( , const ), .
const
Usually, when you implement an operator, you want to work directly with the operand, and not with its copy, but when passing the pointer, you risk deleting the memory inside the operator. (Yes, it would be stupid, but nevertheless it would be a significant danger.) Links allow you to use a convenient way to access the pointer, not related to the "assignment of responsibility" that bears the passage of pointers.
Source: https://habr.com/ru/post/1739666/More articles:Converting C # void * to Byte [] - pointersIs there a library for .NET that does brackets or expression reduction and optimization? - .netProblems with Date, readyStatement, JDBC and PostgreSQL - javaМогу ли я получить данные из запроса ajax с помощью глобального обработчика .ajaxSuccess? - jqueryКак получить двоичный файл из сборки .NET? - c#Python output alternatives - pythonMemory in Eclipse - heapBlackBerry deployment and release - deploymentAndroid newbie: touch events in gridview - androidWhich one would you recommend for a beginner transitioning from ado.net? - asp.netAll Articles