
Untitled
By: a guest on
Apr 24th, 2012 | syntax:
None | size: 1.16 KB | hits: 8 | expires: Never
Is there a better way to comment the parameters' direction in code?
#define IN
#define OUT
void Add(IN int Para1, IN int Para2, OUT int& Result);
void foo(int i, const std::string& s, std::vector<char>& out_buf);
// i and s are obviously "in" variables, while out_buf could be both,
// but you can easily show that by giving the parameter a proper name.
void Add(/*IN*/ int Para1, /*IN*/ int Para2, /*OUT*/ int& Result);
/*Description : Function for adding the two variables.
* Returns : Nothing
* Parameters : Para1 and Para2 are **IN** parameter and
* Result is an **OUT** parameter
* @author : <put ur name here>
*/
void Add(IN int Para1, IN int Para2, OUT int& Result);
void Add(int inPara1,int inPara2,int& outResult);
void Add(
/* input parameters */
int Para1,
int Para2,
/* output parameters */
int& Result
);
void f(int x);
void f(const Foo& read_only_foo);
void f(int& x);
ostream& operator<<(ostream& os, const Foo& foo);
// fills the specified list with stuff
void some_list(list<int>& out_list);
// returns a new list filled with stuff
list<int> some_list();