template<class _Ty0 = int>
    class inc_num
    { // inc num
    _Ty0 what;
public:
    inc_num(_Ty0 f)
        : what(f)
        {}
    inc_num()
        {what = (_Ty0)0;}
    _Ty0 operator()()
        { // operator()
        return what++;}
    };

template<class _Ty7, class _Func> inline
    void func_tetragon(_Ty7& that,
        int line, int queue, _Func& what,
            int depth = 0)
    {
    for(int i = depth, f = depth, g = 0; g == 0 ? f <= queue - depth :
        g == 1 ? i <= line - depth :g == 2 ? f >= depth : i >= depth +
        1; g == 0 ? f++ : g == 1 ? i++ : g == 2 ? f-- : i--,f == queue
        - depth && g == 0 ? that[i][f] = what(), g = 1, i = depth + 1,
        f = queue - depth : i == line - depth && g == 1 ? that[i][f] =
        what(), g = 2, i = line - depth, f -= 1 :f == depth && g == 2
        ? that[i][f] = what(), g = 3, f = depth, i -= 1 : 0)
        that[i][f] = what();
    }



스택오버플로우펌