• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運轉,開心的工作
            簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            pass variable-argument list

            Posted on 2013-05-18 10:45 S.l.e!ep.¢% 閱讀(668) 評論(0)  編輯 收藏 引用 所屬分類: C++

            Introduction

            I've been looking for solution of passing variable-argument list from my va-function to another one, like TRACE for example. All solutions I saw were about using special functions that take va_list as argument. But this is a un-straight way. Why couldn't I just pass "..." to next function? C++ syntax doesn't allow this. But C++ allows to extend itself. Let me introduce you new macros from va_ set:

            template<byte count>
            struct SVaPassNext{
                SVaPassNext<count-1> big;
                DWORD dw;
            };
            template<> struct SVaPassNext<0>{};
            //SVaPassNext - is generator of structure of any size at compile time.class CVaPassNext{
            public:
                SVaPassNext<50> svapassnext;
                CVaPassNext(va_list & args){
            		try{//to avoid access violation
            			memcpy(&svapassnext, args, sizeof(svapassnext));
            		} catch (...) {}
                }
            };
            #define va_pass(valist) CVaPassNext(valist).svapassnext#if 0 //using:void MyVA_Function(szFormat, ...){
                va_list args;
                va_start(args, szFormat);
                SomeOtherVA_Function(szFormat, va_pass(args));
                va_end(args);
            }
            #endif
            how this works:
            I just copy 50 * sizeof(DWORD) bytes of stack to my struct of this size and simply pass this struct as ... argument to next function. Compiler just copies my copy of local stack to next function stack. And that's all we need.

            Enjoy!
            日韩人妻无码一区二区三区久久99| 欧美午夜A∨大片久久| 精品国产乱码久久久久久呢| 久久精品国产免费观看| 色综合久久久久久久久五月| 色8久久人人97超碰香蕉987| 久久国产乱子精品免费女| 精品水蜜桃久久久久久久| 99久久国产亚洲综合精品| 精品国产乱码久久久久久1区2区 | 国产精品久久自在自线观看| 国产成人香蕉久久久久| 久久久久久精品无码人妻| 久久精品国产91久久综合麻豆自制 | 国产呻吟久久久久久久92| 久久人人爽人人爽AV片| 亚洲色欲久久久综合网东京热| 色综合久久中文字幕综合网| 漂亮人妻被黑人久久精品| 久久99精品免费一区二区| 伊人久久大香线蕉av不卡 | 国产成人久久激情91| 久久这里的只有是精品23| 国内精品久久久久久久影视麻豆| 久久丫精品国产亚洲av| 亚洲一区精品伊人久久伊人| 99久久精品免费看国产| 国产成人久久精品区一区二区| 亚洲精品国产美女久久久| 久久精品极品盛宴观看| 久久涩综合| 久久久久久久久久免免费精品| 免费精品99久久国产综合精品| 久久久精品人妻一区二区三区蜜桃| 亚洲乱码日产精品a级毛片久久| 精品久久久久久久久久中文字幕| 四虎国产永久免费久久| 久久久青草久久久青草| 精品久久久久久国产牛牛app| 久久精品无码专区免费| 免费一级做a爰片久久毛片潮|