I have a list of bools, and I am trying to convert it into one \_int64. The list of bools is being created by a string of 8 characters, so it will never go over a length of 64.

I tried doing this:

I pass a const std::list< bool >& binList into the function.

```
_int64 x = 0;
for(auto citer = binList.begin();citer!=binList.end();citer++{
    x*=10;
    if(*citer) x++;
}

```

This obviously doesn't work because if there is a list of 0's the int will never get larger, but the output I get doesn't even contain only 1's and 0's. It contains random numbers. Not quite sure the best way to do this. Thanks in advance.

Asked for an example, so here is one:
binList contains:

{0,1,1,0,1,0,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,1,1}

When I run it through that loop, x = -3830736327776896713.

If it is not clear, I would LIKE x to contain 01101000011001011000110110001101111.