Sort and find functions in the generic linked list
<p>This is my code after lots of changes that I did.I have a problem with to functions (sort and find) but I still can't understand how to solve it.</p>

<pre><code>using namespace std;    
using namespace ListExceptions;

template &lt;typename T&gt; class Node;
template &lt;typename T&gt; class Iterator;

/*List class*/
template &lt;typename T&gt;
class List{
private:
Node&lt;T&gt; * first;
Node&lt;T&gt; * last;
int size;
friend class Predicate;
friend class Compare;
public:
typedef Iterator&lt;T&gt; iterator;
List(){
   first = NULL;
   last = NULL;
   size = 0;
}
List(const List&lt;T&gt; &amp; l);
void pushBack(T element);
void insert( const T&amp; element, iterator i);
iterator remove(iterator i);

iterator find(const Predicate&amp; predicate(const T element));//line 47
void sort(const Compare&amp; comparer());//line 48

int getSize() const;
iterator begin();
iterator end();
~List();
};

/*Implimentation of List functions*/
template &lt;class T&gt;
List&lt;T&gt;::List(const List &amp; l) {
first = 0;
last = 0;
size = 0;
for (Node&lt;T&gt; * current = l.first; current != 0; current = current -&gt; next){
    pushBack(current -&gt; data);
}
}

template &lt;typename T&gt;
void List&lt;T&gt;::pushBack(T element){
Node&lt;T&gt;* newnode = new Node&lt;T&gt;(element);
if (newnode-&gt;prev == NULL) {
  first = newnode;
  last = newnode;
}else{
  newnode-&gt;prev = last;
  last-&gt;next = newnode;
  last = newnode;
}
}

template &lt;typename T&gt;
void List&lt;T&gt;::insert( const T&amp; element, iterator i){
if (i.position == NULL){
  pushBack(element);
  ++size;
  return;
}
Node&lt;T&gt;* after = i.position;
Node&lt;T&gt;* before =  after-&gt;prev;
Node&lt;T&gt;* newnode = new Node&lt;T&gt;(element);
newnode-&gt;prev = before;
newnode-&gt;next = after;
after-&gt;prev = newnode;
if (before == NULL) {
  first = newnode;
}
else{
  before-&gt;next = newnode;
}
++size;
}

template &lt;typename T&gt;
typename List&lt;T&gt;::iterator List&lt;T&gt;::remove(iterator iter){
  if(iter.position != NULL){
      Node&lt;T&gt;* remove = iter.position;
       Node&lt;T&gt;* before = remove-&gt;prev;
       Node&lt;T&gt;* after = remove-&gt;next;
       if (remove == first){
           first = after;
       } else{
           before-&gt;next = after;
       }
       if (remove == last){
           last = before;
       }else{
           after-&gt;prev = before;
       }
       iter.position = after;
       --size;
       delete remove;
       return iter;
   }else{
   throw ElementNotFound();
    }
}

template &lt;typename T&gt;
typename List&lt;T&gt;::iterator List&lt;T&gt;::begin(){
return iterator(first);
}

template &lt;typename T&gt;
typename List&lt;T&gt;::iterator List&lt;T&gt;::end(){
if(size != 0){
    return iterator(last);
}
throw ElementNotFound();
}

//TODO
template &lt;typename T&gt;
template &lt;typename Predicate&gt;
typename List&lt;T&gt;::iterator List&lt;T&gt;::find(const Predicate&amp; predicate(const T element))  {//line145
iterator iter;
Node&lt;T&gt;* current = iter.position;
Node&lt;T&gt;* end = iter.last;
for( ; current != end; ++current){
    if( predicate(*current)){
        return current;
    }
}
return end;
}

//TODO
template &lt;typename Compare&gt;
template &lt;typename T&gt;
void List&lt;T&gt;::sort(const Compare&amp; comparer()){//line154
Iterator&lt;T&gt; current = position;
Iterator&lt;T&gt; end = last;
for( ; current != end; ++current){
    if( comparer( *current , *current+1) != true){

    }
}
}

template &lt;typename T&gt;
int List&lt;T&gt;::getSize() const{
return size;
}

template &lt;class T&gt;
List &lt;T&gt;::~List() {
Node &lt;T&gt; * firstNode = first;
while (firstNode != 0)     {
    Node &lt;T&gt; * nextNode = firstNode-&gt;next;
    delete firstNode;
    firstNode = nextNode;
}
}

/*Node Class*/
template &lt;typename T&gt; class Node {
private:
T data;
Node* next;
Node* prev;
friend class List&lt;T&gt;;
friend class Iterator&lt;T&gt;;
public:
Node(T element){
    data = element;
    prev = NULL;
    next = NULL;
}
~Node(){}
};

/*Iterator class*/
template &lt;typename T&gt; class Iterator{
private:
Node&lt;T&gt;* position;
Node&lt;T&gt;* last;
friend class List&lt;T&gt;;
public:
Iterator(){
   position = NULL;
   last = NULL;
}
Iterator(Node&lt;T&gt; * source): position(source) { }
T&amp; getElement()const;
bool operator==(Iterator b) const;
bool operator!=(Iterator b) const;
T &amp; operator*();
Iterator &amp; operator++();
Iterator &amp; operator++(int);
~Iterator(){}
};

/*Implimentation of Iterator class function*/
template &lt;class T&gt;
T&amp; Iterator&lt;T&gt;::getElement() const{
if(position != NULL){
   return position-&gt;data;
}
else{
   throw ElementNotFound();
}
}

template &lt;typename T&gt;
bool Iterator&lt;T&gt;::operator==(Iterator b) const{
return position == b.position;
}

template &lt;typename T&gt;
bool Iterator&lt;T&gt;::operator!=(Iterator b) const{
return position != b.position;
}

 template &lt;typename T&gt;
  T &amp; Iterator&lt;T&gt;::operator*() {
return position-&gt;data;
 }

 template &lt;class T&gt;
 Iterator&lt;T&gt; &amp; Iterator&lt;T&gt;::operator++() {
position = position-&gt;next;
return *this;
 }

template &lt;class T&gt;
Iterator&lt;T&gt; &amp; Iterator&lt;T&gt;::operator++(int){
position = position-&gt;next;
return *this;
}
</code></pre>

<p>The messages that I recieve are:</p>

<pre><code>C:/Programs/eclipse-with-gcc/eclipse/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/cwchar:161: error: `::swprintf' has not been declared
C:/Programs/eclipse-with-gcc/eclipse/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/cwchar:168: error: `::vswprintf' has not been declared

..\list.h:140: error: expected constructor, destructor, or type conversion before "List"
..\list.h:154: error: no member function `sort' declared in `List&lt;T&gt;'
..\list.h:154: error: invalid function declaration
</code></pre>
