#include <iostream>
using namespace std;

    template <class T>
    struct clearable
    {
        void clear()
        {
            static T _clear;
            *((T*)this) = _clear;
        };
    };

    class test : public clearable<test>
    {
        public:
            int a;
    };

    int main()
    {
        test _test;
        _test.a=3;
        _test.clear();

        printf("%d", _test.a);
	
        return 0;
    }
