cpp11-range
cpp11-range copied to clipboard
fix bug int/size_t
Hello,
I find a bug (not really I just improve). If you are doing a range like
std::size_t size(9999);
for(int i: range(0:size))
//blablabla
This will not compile as size is uint64_t and 0 is an int. The compiler will complain because there are two type and range use only one.
I fix it using an identity struct from my past experience (http://stackoverflow.com/questions/26705581/operator-and-float-argument) Some more advance meta-programming may do the job, but I am not template guru.
Free to you to merge it, but at least in my version I fix it.
Best,
Tim