Language: C++

#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;

template<typename T>
class List{
private:
    typedef unsigned long ul;
    
    struct node{
        node* front;
        node* back;
        T a;
    };
    
    ul Size;
    node* root;
    
    node* create(T a){
        node* New=(node*)malloc(sizeof(node));
        assert(New!=NULL);
        (*New).a=a;
        return New;
    }
    
public:
    struct iterator{
        node* where;
        
        iterator(node* where):where(where){}
        
        iterator(T* t){
            char* C=(char*)t;
            C-=2*sizeof(node*);
            where=(node*)C;
        }
        
        iterator operator ++ (){
            return where=(*where).back;
        }
        
        iterator operator -- (){
            return where=(*where).front;
        }
        
        bool operator == (const iterator &I) const {
            return where==I.where;
        }
        
        bool operator != (const iterator &I) const {
            return where!=I.where;
        }
        
        T & operator * (){
            return (*where).a;
        }
        
        T* pointer(){
            return &(*where).a;
        }
    };
    
    List(){
        Size=0;
        root=create(T());
        (*root).back=root;
        (*root).front=root;
    }
    
    iterator begin(){return iterator((*root).back);}
    
    iterator end(){return iterator(root);}
    
    ul size(){return Size;}
    
    iterator push_back(T a){
        node* New=create(a);
        node* F=(*root).front;
        (*F).back=New;
        (*New).front=F;
        (*root).front=New;
        (*New).back=root;
        Size++;
        return iterator(New);
    }
    
    iterator push_front(T a){
        node* New=create(a);
        node* B=(*root).back;
        (*root).back=New;
        (*New).fonrt=root;
        (*B).front=New;
        (*New).back=B;
        Size++;
        return (New);
    }
    
    iterator pop_back(){
        if(Size==0){return root;}
        node* E=(*root).front;
        node* F=(*E).front;
        (*F).back=root;
        (*root).front=F;
        free(E);
        Size--;
        return iterator(root);
    }
    
    iterator pop_front(){
        if(Size==0){return root;}
        node* E=(*root).back;
        node* B=(*E).back;
        (*B).front=root;
        (*root).back=B;
        free(E);
        Size--;
        return iterator(B);
    }
    
    iterator erase(iterator where){
        node* E=where.where;
        if(Size==0 || E==root){return iterator(root);}
        node* F=(*E).front;
        node* B=(*E).back;
        (*F).back=B;
        (*B).front=F;
        free(E);
        Size--;
        return B;
    }
    
    iterator erase(char* where){
        return erase(iterator(where));
    }
    
    iterator erase(node* E){
        if(Size==0 || E==root){return iterator(root);}
        node* F=(*E).front;
        node* B=(*E).back;
        (*F).back=B;
        (*B).front=F;
        free(E);
        Size--;
        return B;
    }
};



int main(){
    List<ll> L;
    ll n;
    cin>>n;
    while(n--){
        string s;
        cin>>s;
        if(s=="insert"){
            ll x;
            cin>>x;
            L.push_front(x);
        }
        else if(s=="delete"){
            ll x;
            cin>>x;
            for(auto i=L.begin();i!=L.end();++i){
                if((*i)==x){L.erase(i); break;}
            }
        }
        else if(s=="deleteFirst"){
            L.pop_front();
        }
        else{
            L.pop_back();
        }
    }
    
    
    
    return 0;
}


Compiler output:
a.cc: In instantiation of 'List<T>::iterator List<T>::push_front(T) [with T = long long int]':
a.cc:188:25:   required from here
  188 |             L.push_front(x);
      |             ~~~~~~~~~~~~^~~
a.cc:119:16: error: 'struct List<long long int>::node' has no member named 'fonrt'
  119 |         (*New).fonrt=root;
      |         ~~~~~~~^~~~~