re: C question 

@amiloradovsky The "in" equivalent (can't write to) would be a const/pointer to const/reference to const.
There is no "out" equivalent (can't read from) in C/C++, the languages only distinguish "in" from "in/out". Pointer to pointer/reference to pointer are sometimes used with an "out" meaning in function arguments when you allocate a structure inside the function, but nothing prevents you from reading those.
In C++, you can at best encapsulate an "out" structure with a class providing only setters, and deleting the default copy primitives (copy constructor, affectation operator).

Follow

re: C question 

@Feufochmar @amiloradovsky@functional.cafe out values are return values, so providing out values, is same as asking for values to be returned/passed to you. That's how you can think of that class - an interface definition. There should be no deleting of copy constructors I think, if your value is unique, then it should be a static member or if that's not an option - a member reference.

· · SubwayTooter · 0 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.