• <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.¢% 閱讀(661) 評論(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!
            区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 久久r热这里有精品视频| 久久久久亚洲av无码专区导航| 久久精品国产亚洲AV无码麻豆| 久久久综合九色合综国产| 午夜精品久久久久9999高清| 久久婷婷成人综合色综合| 91麻豆精品国产91久久久久久| 免费精品国产日韩热久久| 久久777国产线看观看精品| 日韩美女18网站久久精品| 国产精品久久久久9999| 一97日本道伊人久久综合影院| 国产精品一区二区久久精品| 2019久久久高清456| 日韩十八禁一区二区久久| 青青青青久久精品国产| 久久人人爽人人爽人人片AV不 | 久久天天躁夜夜躁狠狠| 成人a毛片久久免费播放| 久久午夜无码鲁丝片| 亚洲国产成人精品久久久国产成人一区二区三区综 | 亚洲午夜久久久| 久久精品无码av| 久久久WWW成人| 品成人欧美大片久久国产欧美... 品成人欧美大片久久国产欧美 | 品成人欧美大片久久国产欧美...| 日本人妻丰满熟妇久久久久久| 亚洲国产精品综合久久一线| 久久久无码精品午夜| 久久久久久国产a免费观看不卡| 国产一区二区精品久久| 91精品国产综合久久精品| AAA级久久久精品无码片| 久久精品国产亚洲av麻豆小说| 亚洲色婷婷综合久久| 亚洲午夜久久久久久久久电影网| 久久久久亚洲av综合波多野结衣| 久久99九九国产免费看小说| 久久精品国产亚洲AV蜜臀色欲 | 久久精品二区|