From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-04-24 13:09:36
Noel Yap said:
> "Justin M. Lewis" wrote:
>> in/out seems to be used fairly commonly in COM. I'm not sure I have
>> any great examples off the top of my head, but I know they're commonly
> I'm not a COM person, but I believe it's written in C. If so, then you
> are correct that in/out parameters are more needed since noone would
> want to create a struct for each multiple return type.
COM can be coded in any language. In COM, as in every RPC mechanism I
have experience with, in/out attributes are used to optimize how things
are wired (or not). That they might also be meaningful to someone
reading/maintaining the code is just a side effect.
> OTOH, C++ has templates to deal with this situation (ie boost::tuple<>)
> so, qualifying my previous statement, in C++ I still see no need for
> in/out parameters.
Same reason as with RPC... though all it really would do is make the
compilers job easier in optimizing code. (Note that I'm not advocating
-- William E. Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk