Skip to content

fix bug int/size_t#1

Open
timocafe wants to merge 1 commit into
harrism:masterfrom
timocafe:master
Open

fix bug int/size_t#1
timocafe wants to merge 1 commit into
harrism:masterfrom
timocafe:master

Conversation

@timocafe
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant