Except for the fact, that it would probably confuse every windows c++ developer out there,
wouldn't it be prudent to expand _In_
to a mandatory const
(if not already present) to ensure const correctness?
So
int DoSomething( _In_ int * pInput);
becomes
int DoSomething( const int * pInput);
Obviously _[In]Out_ should still expand to nothing.
Edit: Obviously the first problem is that, this only makes sense when expanding in front of a pointer or a reference parameter.
So maybe a simpke macro expansion will not suffice. I don't want to abandon the notion of enforcing const
just yet. The motto is: We already have a SAL
notation that tells us what parameter is ro
and what not, let's make some use of it.
Assuming it's a macro expansion, that wouldn't work for values copied into parameters, i.e.