[std-interval] passing by value vs reference
Sylvain Pion
Sylvain.Pion at sophia.inria.fr
Wed Apr 5 16:26:51 PDT 2006
Guillaume Melquiond wrote:
> Le mercredi 05 avril 2006 à 11:32 +0200, Sylvain Pion a écrit :
>
>
>>3- leave freedom for the implementation to choose
>>4- leave freedom for the implementation and have it provide
>> a standard specified way to obtain this information.
>
>
>>I would prefer 3 to 4. I think
>>the complexity of implementing 4 is not worth it.
>
>
> I don't see any additional complexity in 4 with respect to 3. As already
> mentioned by Bill Clarke, you could simply have a typedef member in
> interval<T> to express the calling convention of the functions of the
> interval library: typedef interval<T> const ¶m_type;
>
> This requires all the functions of the library to use the same calling
> convention. But I don't think it is too strong a requirement since there
> is no function that uses more than two interval arguments.
I meant complexity for the proposal. I think this issue has the
potential to raise questions I would prefer to avoid discussing
if possible, like:
- should this be a mecanism applicable to the whole std library
types instead?
- should it be fine grained for each argument of each function?
- is such a type-based mecanism enough for all users needs
(or is a macro necessary for example)?
For example: how would a user defined template function on
intervals be defined to play nicely with this implementation
"preference":
template < typename T >
void f(std::interval<T>::param_type i)
does not work.
So, let's first hear if there is a need for such a mechanism at all,
or if the "unspecified" approach, 3, is good enough.
--
Sylvain
More information about the Std-interval
mailing list