Re: [eigen] min(Arr1,Arr2) is it supposed to work?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 04/04/11 17:07, Helmut Jarausch wrote:

I've always wondered why the functions should live in the std
namespace.
Isn't it possible to define a template for min in the namespace Eigen
requiring the user to use Eigen::min (or a using instruction)?

Helmut.



Users should do the following:

 - pull std::min in current scope using 'usign std::min'
 - call min unqualified

By doing so if their generic type are in Eigen namespace, Eigen::min will be used by ADL, if not regular one will be.

it is always a godo idea to rely on ADL in these cases. So if Eigen
provides min in namespace Eigen for types living in namespace Eigen,
nothing is required.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/