You do not call std::copy according to msdn: http://msdn.microsoft.com/en-us/library/x9f6s1wf.aspx
This function signature is as follows:
template<class InputIterator, class OutputIterator> OutputIterator copy( InputIterator _First, InputIterator _Last, OutputIterator _DestBeg );
There is no room for a functor / lambda.
You do not call std::copy_if : http://msdn.microsoft.com/en-us/library/ee384415.aspx
template<class InputIterator, class OutputIterator, class BinaryPredicate> OutputIterator copy_if( InputIterator _First, InputIterator _Last, OutputIterator _Dest, Predicate _Pred );
Since you do not have an output iterator, and your predicate does not return bool.
It looks like you want std::transform : http://msdn.microsoft.com/en-us/library/391xya49.aspx
template<class InputIterator, class OutputIterator, class UnaryFunction> OutputIterator transform( InputIterator _First1, InputIterator _Last1, OutputIterator _Result, UnaryFunction _Func );
And you should return the required value in the output iterator. So, it will be something like this:
std::transform( dwNames, dwNames + dwNumberOfNames, std::back_inserter(exports), [&hDLL](DWORD dwFuncOffset) // This lambda is WRONG { // THIS LINE IS WRONG std::string fname = std::string((PCHAR)((PBYTE)hDLL + dwFuncOffset)); return fname; } );
My lambda is wrong. You need to enter the ELEMENTS of your array (I'm not sure of the type) as the lambda argument and return what you want to insert into the exports vector.
You probably also did not know about back_inserter . It is located in the <iterator> header. See here: http://msdn.microsoft.com/en-us/library/12awccbs.aspx and here: http://www.cplusplus.com/reference/iterator/back_inserter/
This may not be a 100% answer, but with this, I think you can get where you want to go.