Subject: Re: [boost] [call-traits][param_type] why is sizeof(void*) chosen as the limit for passing by value?
From: Jeffrey Hellrung (jhellrung_at_[hidden])
Date: 2010-04-15 12:45:43
Thorsten Ottosen wrote:
> Hi Boosters,
> It seems to me that many other slightly larger types could benefit from
> pass by value. For example, I rarely write
> With this in mind, I think we should consider changing the limit for
> param_type to sizeof(long double) or even 2*sizeof(int). Of course,
> we should only pass types with a trivial assignment operator by value.
By "trivial assignment operator", you really mean "trivial copy
You might want the "by-value size limit" to be platform dependent. I
can imagine that the limit for 64-bit systems could arguably be twice
that for 32-bit systems.
Do you find the same optimization opportunity when passing a
pair<float,float> by value as you did for passing a double by value?