• <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.¢%

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

            pass variable-argument list

            Posted on 2013-05-18 10:45 S.l.e!ep.¢% 閱讀(662) 評(píng)論(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国产综合精品女同| 久久久久亚洲爆乳少妇无| 日韩精品久久久久久久电影| 丁香色欲久久久久久综合网| 久久国产精品一国产精品金尊 | 麻豆成人久久精品二区三区免费| 99久久夜色精品国产网站| 欧美一区二区精品久久| 久久无码专区国产精品发布 | 国内精品伊人久久久久影院对白| 无码8090精品久久一区| 91性高湖久久久久| 囯产精品久久久久久久久蜜桃 | 国产成人综合久久精品尤物| 久久91精品国产91| 久久九九久精品国产免费直播| 久久精品亚洲日本波多野结衣| 亚洲欧美日韩精品久久亚洲区| 国产精品福利一区二区久久| 久久精品国产精品亚洲精品| 国产综合精品久久亚洲| 精品久久久久久| 久久水蜜桃亚洲av无码精品麻豆| 久久夜色精品国产噜噜亚洲a| 久久久久久极精品久久久| 色综合色天天久久婷婷基地| 99久久精品国内| 久久美女网站免费| 97精品伊人久久大香线蕉app | 99久久国产精品免费一区二区| 欧美久久天天综合香蕉伊| 国产精品99久久久久久猫咪| 国内精品久久久久影院网站| 精品国产热久久久福利| 国产亚洲色婷婷久久99精品91 | 亚洲AV无码久久寂寞少妇| 中文字幕久久久久人妻| 亚洲第一极品精品无码久久 | 色综合久久天天综合| 一级做a爰片久久毛片16|