Q:

for_each for Node manually c++

How can I implement for_each for that implementation of Node and List? 
I'm sure it's not long code, can some share a few strokes of his knowledge please? Do I need to implement it as template or just as inner function.
Thanks for helping. 
class Node {
    int data;
    Node *next;

  public:
    Node() {}
    void SetData(int aData) { data = aData; }
    void SetNext(Node *aNext) {
        next = aNext;
    }
    int Data() { return data; }
    Node* Next() { return next; }
};

// List class

class List {
    Node *head;
  public:
    List() { head = nullptr; }
    void Append(int data){

        // Create a new node
        Node *newNode = new Node();
        newNode->SetData(data);
        newNode->SetNext(nullptr);

        // Create a temp pointer
        Node *tmp = head;

        if ( tmp != nullptr ) {
        // Nodes already present in the list
        // Parse to end of list
        while ( tmp->Next() != nullptr) {
            tmp = tmp->Next();
        }

        // Point the last node to the new node
        tmp->SetNext(newNode);
        }
        else {
        // First node in the list
        head = newNode;
        }
    }
    void Delete(int data){

        // Create a temp pointer
        Node *tmp = head;

        // No nodes
        if ( tmp == nullptr ) return;

        // Last node of the list
        if ( tmp->Next() == nullptr ) {
            delete tmp;
            head = nullptr;
        }
        else {
            // Parse thru the nodes
            Node* prev;
            do {
            if ( tmp->Data() == data ) break;
                prev = tmp;
                tmp = tmp->Next();
            } while ( tmp != nullptr );

            // Adjust the pointers
            if (tmp->Next()!=nullptr) prev->SetNext(tmp->Next());
            else prev->SetNext(nullptr);

            // Delete the current node
            if (tmp!=nullptr) delete tmp;
        }
    }
};

EDIT:
This is use of iterator:
for (List<Pair, CompareFunction>::myIterator it = this->_pairs.begin();
            it != this->_pairs.end(); ++it) {
                Pair cur_pair = *it;
                if (cur_pair.first == key) {
                    this->_pairs.Delete(cur_pair);
                    this->_size--;
                }
            }

This is Pair Class as sub-class in another template class:
template <class KeyType, class ValueType, class CompareFunction = std::less<KeyType> >
    class MtmMap {

    public:
        class Pair {
        public:
            Pair():first(KeyType()){} ////////////////////
            Pair(const KeyType& key, const ValueType& value)
                : first(key), second(value) {}

            const KeyType first;
            ValueType second;

            ~Pair() = default;

In our concrete case KeyType and ValueType run as both int.

A:

Add the following code into your List class:
class List{
    ...

    class myIterator
    {
    public:
        typedef myIterator self_type;
        typedef Node* pointer;

        myIterator(pointer ptr) : ptr_(ptr) { }
        self_type operator++() {
            self_type i = *this;
            if (ptr_) ptr_ = ptr_->Next();
            return i;
        }
        int operator*() { if (ptr_ ) return ptr_->Data(); else return 0; }
        bool operator==(const self_type& rhs) {
            if (!ptr_ && !rhs.ptr_) return true;
            return (ptr_ && rhs.ptr_ && rhs.ptr_->Data()==ptr_->Data());
        }
        bool operator!=(const self_type& rhs) {
            return !(*this==rhs);
        }
    private:
        pointer ptr_ = nullptr;
    };

    myIterator begin() { return myIterator(head); }
    myIterator end() { return myIterator(nullptr); }
};

You may then use normal iterators like in the following example:
List l;
l.Append(2);
l.Append(5);
l.Append(7);
l.Append(11);
for (int i: l) std::cout << i << std::endl;
//or
for (myIterator it=l.begin(); it!=l.end(); ++it) std::cout << *it << std::endl;

