115 line brainfuck interpreter written in C++
I see some things that may help you improve your program.

Use all of the required #includes

The function std::strchr is used but its declaration is in #include &lt;cstring&gt; which is not actually in the list of includes.

Be careful with signed and unsigned

In the interpret routine, the code compares an int i to a size_t (because that's what is returned from source.size()) but size_t is unsigned and int is signed.  Instead, declare i as size_t.

Copy and filter in one step

It's not wrong, by any means, but I'd be inclined to copy and filter all at once rather than as two separate steps.  Here's one way to do that:

std::vector&lt;char&gt; source; 
std::copy_if(std::istream_iterator&lt;char&gt;(std::cin), std::istream_iterator&lt;char&gt;(), 
             std::back_inserter(source), 
             [](char c) { return std::strchr("&lt;&gt;+-[],.", c); }
            );


It's not critical, of course, but this way it minimizes the number of times the vector is resized.  Also note that I've altered the program to read from std::cin instead of a file.  This way, it's possible to take input from a unnamed pipe, for example, adding to the flexibility of the program.

Fix the bugs

The current implementation doesn't check to see if it runs off the end of the vector while processing a brace and it doesn't check to see that h doesn't go out of bounds.