
28 Nov
2009
28 Nov
'09
12:25 a.m.
Lubomir Bourdev escribió:
While some channel types are classes, a built-in type such as ‘unsigned char’ is a valid channel. We have to be careful so we don’t slow down operations on common 8-bit images. I think it is safe to replace “Channel” with “const Channel” but “const Channel&” has a size of a pointer and this is far bigger than unsigned char.
Perhaps to do this right one needs to create a metafunction that returns the type by value or by const reference, whichever is faster.
Lubomir
call_traits< T >::param_type does that. "Defines a type that represents the "best" way to pass a parameter of type T to a function." http://www.boost.org/doc/libs/1_41_0/libs/utility/call_traits.htm Agustín K-ballo Bergé.- http://talesofcpp.blogspot.com