Proper arguments as const or operands
문제
Do you feel it is important to strictly use const
every time the value won't be changed or pass arguments as pointers only when the data will be modified?
I'd like to do things right but if a struct
passed as an argument is large in size, don't you want to be passing the address instead of copying the data? Usually it seems like just declaring the struct
argument as an operand is most functional.
//line1 and line2 unchanged in intersect function
v3f intersect( const line_struct line1, const line_struct line2);
//"right" method? Would prefer this:
v3f intersect2( line_struct &line1, line_struct &line2);
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow