This code is from: https://codeforces.net/blog/entry/86731 ~~~~~ struct Line { data_t a, b;
Line() : a(0), b(-inf) {} Line(data_t a, data_t b) : a(a), b(b) {}
data_t get(data_t x) { return a * x + b; } }; ~~~~~
I have no idea what the colon marks in the code means?
It is used in constructors to initialize member variables of classes/structs. The variables outside the parentheses are member variables and the values within the corresponding parentheses are the values to which you initialize the member variables.
This is generally the preferred method of initializing values in classes/structs when possible.
One advantage of this synatax is that it allows one to initialise a const variable with some value. This can be helpful if we don't want to change size of a structure after it is initialised.
I got it, thanks.