Re: if-else-if chains to switch conversion optimization

2015-05-18 Thread Richard Biener
On Fri, May 15, 2015 at 7:47 PM, Daniel Gutson wrote: > Hi, > > the particular motivation is a TMP compile-time search of an > element, but could be extended to other scenarios. > > In my example, given: > > template > struct Static_Find > { > static size_t find(size_t /*target*/) > { >

if-else-if chains to switch conversion optimization

2015-05-15 Thread Daniel Gutson
Hi, the particular motivation is a TMP compile-time search of an element, but could be extended to other scenarios. In my example, given: template struct Static_Find { static size_t find(size_t /*target*/) { return 0; } }; template struct Static_Find { static size_t