• <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久久99久久精品免费看蜜桃| 国产精品久久国产精麻豆99网站 | 亚洲香蕉网久久综合影视| 97久久婷婷五月综合色d啪蜜芽| 99久久国产宗和精品1上映| 国产亚洲婷婷香蕉久久精品| AV无码久久久久不卡蜜桃| 99久久精品国产高清一区二区 | 久久精品国产亚洲av水果派| 综合久久一区二区三区| 久久久无码精品午夜| 国产女人aaa级久久久级| 久久99热精品| 久久精品一区二区三区AV| 久久精品视频一| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 国产高潮国产高潮久久久91 | 午夜精品久久久久久影视777| 国产精品一区二区久久精品无码| 精品久久久中文字幕人妻| 久久无码人妻精品一区二区三区| 久久精品国产只有精品2020| 久久精品夜夜夜夜夜久久| 亚洲精品无码久久久久去q| 久久天天躁狠狠躁夜夜96流白浆 | 久久久国产精品福利免费| 久久综合欧美成人| 久久久久久人妻无码| 亚洲国产精品久久电影欧美| 亚洲va久久久久| 久久婷婷色香五月综合激情 | 色综合久久无码五十路人妻| 欧美国产成人久久精品| 久久精品欧美日韩精品| 久久精品国产免费观看| 伊人久久大香线蕉综合Av| 国色天香久久久久久久小说 | 久久夜色精品国产亚洲av| 精品熟女少妇aⅴ免费久久| 国色天香久久久久久久小说| 久久国语露脸国产精品电影|