Quote:Original post by the_eddQuote:Original post by johnstanp
I had problems understanding the traits mechanism which I thought was related to type information...
It usually is used for that, but that's not the heart of the concept. Traits allow you to use 3rd party code with yours without changing the 3rd party implementation. Concept maps in the next revision of the standard takes this idea even further.
The other plus of this is that you don't need to add an extra warty template parameter to your vector class.
I didn't pay close attention to the mechanism you provided. Actually, depending of the type parameter of my vector class, a template specialization would be chosen: so I won't need passing a pointer. The problem is that I want too, to be able to use std::sqrt() which gives better results thant my sqrt algorithm. As the std::sqrt() uses the same types as my function, if I am not mistaken, I won't be able to use that mechanism.