• <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.¢% 閱讀(669) 評論(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!
            伊人久久久AV老熟妇色| 香蕉久久夜色精品国产小说| 一极黄色视频久久网站| 四虎久久影院| 国产亚洲婷婷香蕉久久精品| 香蕉久久AⅤ一区二区三区| 欧美熟妇另类久久久久久不卡 | yy6080久久| 久久美女人爽女人爽| 性色欲网站人妻丰满中文久久不卡| 99精品久久久久久久婷婷| 亚洲香蕉网久久综合影视 | 97视频久久久| 国产一区二区三区久久精品| 亚洲欧美日韩久久精品| 久久99国产精品一区二区| 久久久久亚洲AV无码观看| 国产亚洲色婷婷久久99精品91| 久久亚洲私人国产精品| 亚洲AV伊人久久青青草原| 国产午夜精品久久久久九九电影| 欧洲人妻丰满av无码久久不卡| 久久中文字幕精品| 女同久久| 亚洲婷婷国产精品电影人久久| 狠狠色综合久久久久尤物| 国产精品99久久精品爆乳| 91精品国产91久久久久久蜜臀| 97久久香蕉国产线看观看| 久久精品蜜芽亚洲国产AV| 人妻精品久久无码专区精东影业 | 伊人久久大香线蕉无码麻豆| 理论片午午伦夜理片久久 | 狠狠色丁香久久婷婷综合图片| 色婷婷噜噜久久国产精品12p| 国产成人无码精品久久久久免费 | 国内精品久久久久影院一蜜桃 | 久久99国产精品久久| 久久99精品久久久久久齐齐| 久久久久久国产a免费观看不卡| 久久久精品久久久久特色影视|