• <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>

            zhujian

            揣著夢想騎驢找馬但不虐待驢
            posts - 10, comments - 7, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            Linux和Windows編譯C++模板問題

            Posted on 2011-07-09 22:52 逐漸 閱讀(2019) 評論(0)  編輯 收藏 引用
            下面是示例代碼,在vs2010下編譯成功,但在linux下編譯報錯。

            基類com_alg代碼片段:
             1 template <typename real_para>
             2 class com_alg
             3 {
             4 public:
             5     com_alg(std::string conf_path)
             6     {
             7         //
             8      }
             9     virtual ~com_alg() { }
            10 };

            子類de_alg代碼片段:
             1 #include "com_alg.h"
             2 
             3 class de_alg
             4     :public com_alg<de_para>
             5 {
             6 public:
             7     de_alg(std::string conf_path):
             8         com_alg(conf_path)
             9     {
            10     }
            11     ~de_alg() { }
            12 };

            注意de_alg代碼第8行紅色部分,在vs2010下編譯通過,但是在linux(g++ 4.4.3)下編譯出錯:
            de_alg.h: In constructor ‘de_alg::de_alg(std::string)’:
            de_alg.h:
            30: error: class ‘de_alg’ does not have any field named ‘com_alg’
            de_alg.h:
            30: error: no matching function for call to ‘com_alg<de_para>::com_alg()’
            com_alg.h:
            29: note: candidates are: com_alg<real_para>::com_alg(std::string) [with real_para = de_para]
            com_alg.h:
            27: note:                 com_alg<de_para>::com_alg(const com_alg<de_para>&)

            將代碼改為com_alg<de_para>(conf_path)編譯通過,大家能幫忙解釋下不?

            歡迎大家訪問我們的開源項目,關于粒子群演化算法的庫,多多提意見--http://code.google.com/p/stupidalgorithm/
            午夜不卡久久精品无码免费| 久久精品成人欧美大片| 久久久久人妻一区精品色| 久久精品一本到99热免费| 精品人妻伦九区久久AAA片69| 久久无码人妻精品一区二区三区 | 久久精品国产亚洲AV忘忧草18| 99久久国产精品免费一区二区| 97久久天天综合色天天综合色hd| 国产精品无码久久四虎| 国产69精品久久久久9999APGF| 国产精品久久久久久久久鸭| 午夜精品久久久久成人| 久久99国产精品尤物| 久久久国产亚洲精品| 狠狠久久综合伊人不卡| 久久无码人妻一区二区三区| 久久亚洲av无码精品浪潮| 久久91综合国产91久久精品| 亚洲AV乱码久久精品蜜桃| 亚洲午夜精品久久久久久app| 亚洲国产成人久久精品影视| 日韩人妻无码精品久久久不卡| 婷婷久久综合九色综合九七| 久久精品国产福利国产秒| 久久亚洲国产成人精品性色| 久久久久久久久66精品片| 久久中文字幕视频、最近更新| 色综合久久久久| 久久久久四虎国产精品| 久久精品国产亚洲AV高清热| 精品国产99久久久久久麻豆| 亚洲va久久久久| 久久只有这精品99| 久久亚洲国产成人影院| 日日狠狠久久偷偷色综合96蜜桃| 91精品国产综合久久香蕉| 久久se这里只有精品| 久久精品国产精品亚洲| 亚洲精品成人久久久| 麻豆精品久久久久久久99蜜桃|