> Formally you're right but I think the difference between use(T&) and
> use(T*) is not significant enough to use them for two very different
> behaviours.
>
It is not a totally different behaviour as in both cases you are passing a
parameter.
The alternative options would be a custom class so
use( soci::output_parameter( x ) );
use( soci::inout_parameter( x ) );
which may well be preferred as it clean code to see what you are making and
you can also use enums rather than booleans to set flags so
use( soci::inout_parameter(x, soci::inout_parameter::input_null ) );
where x could be either a pointer or a non-const reference.
Of course now we are going down that path we don't have to use another
overload for use but could give it a new name like your suggestion of
inout( x, null_indicator );
output( x, null_indicator );
x and null_indicator both need to be writable and it could accept
boost::optional references.
Of course inout and output would be functions and would return the
use_type_ptr like they currently do.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users