Is it possible to define operators in the fpc, like in the c++?
https://www.freepascal.org/docs-html/ref/refch15.html#x212-23400015
Quote from: alsor on March 22, 2021, 06:49:11 pmIs it possible to define operators in the fpc, like in the c++?I take it you did not like C++?
Quote from: engkin on March 22, 2021, 08:06:14 pmQuote from: alsor on March 22, 2021, 06:49:11 pmIs it possible to define operators in the fpc, like in the c++?I take it you did not like C++?no, i'm just total expert in the c++ programming.
inline operator + (int a, int b) { return a * b; }can You rewrite this code to the free-pascal?inline operator + (T3DPoint a, T3DPoint b) { return T3DPoint(a.x+a.x, a.y+b.y, a.z+b.z); }
Quote from: alsor on March 23, 2021, 04:22:36 pmQuote from: engkin on March 22, 2021, 08:06:14 pmQuote from: alsor on March 22, 2021, 06:49:11 pmIs it possible to define operators in the fpc, like in the c++?I take it you did not like C++?no, i'm just total expert in the c++ programming.Why would you bother with Pascal If you are an expert in C++?
inline operator + (int a, int b) { return a * b; }
can You rewrite this code to the free-pascal?inline operator + (T3DPoint a, T3DPoint b) { return T3DPoint(a.x+a.x, a.y+b.y, a.z+b.z); }
And additionally: I begin with pascal long time ago, thus I'm an indisputable pascal expert too.This is a primitive tool in fact, but I can still code everything using it.