• <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!
            久久免费美女视频| 中文字幕亚洲综合久久菠萝蜜| 欧美精品国产综合久久| 精品国产青草久久久久福利| 久久亚洲私人国产精品| 精品久久久久久无码免费| 国内精品伊人久久久影院| 97精品久久天干天天天按摩| 久久久久无码中| 久久精品嫩草影院| 日韩精品无码久久一区二区三| 久久免费的精品国产V∧| 久久久久久亚洲精品不卡 | 2021久久精品国产99国产精品| 国产精品久久久久久影院| 国产精品中文久久久久久久| 亚洲综合婷婷久久| 亚洲色大成网站www久久九| 久久精品国产一区二区| 久久天天躁狠狠躁夜夜网站 | 久久精品国产亚洲av日韩| 久久久久国产一区二区三区| 久久精品国产亚洲av日韩| 久久天天躁夜夜躁狠狠| 色99久久久久高潮综合影院| 久久久久久久尹人综合网亚洲| 亚洲精品乱码久久久久久按摩| 欧洲国产伦久久久久久久| 精品久久久久国产免费| 伊人色综合久久天天| 精品熟女少妇av免费久久| 久久青青草原精品国产| 无码日韩人妻精品久久蜜桃 | 91久久精品视频| 伊人久久综合热线大杳蕉下载| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 久久久国产精品网站| 国产成人久久激情91| 91精品无码久久久久久五月天| 无码人妻少妇久久中文字幕蜜桃| 久久久久高潮综合影院|