Let's focus on the GetActiveCustomerByFunctionField() method. There, we can find an if structure to filter the active customer. As we discussed in the previous chapters, we can use the copy_if() method to filter the condition. The following code snippet implements the copy_if() method to filter the active customer:
template<typename T> vector<T> Customer::GetActiveCustomerByFunctionField( vector<Customer> customers, const shared_ptr<BaseClass<Customer, T>> &classField) { vector<Customer> activeCustomers; vector<T> returnList; copy_if( customers.begin(), customers.end(), back_inserter(activeCustomers), [](Customer customer) { if (customer.isActive) return true; else return false; ...