remove lambda function

I guess predicate function object may be created N times by calling
enqueue/dequeue.
add .gitignore
Merge pull request #1 from atosh/avoid_lambda

switch lambda function to while statement