?!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 使用c++11改写loki的TypeList-南软g开发|׃软g开?南赢dU技软g开发公?/title> <meta name="keywords" content="使用c++11改写loki的TypeList"/> <meta name="description" content="最q看了C++11的一些特性,最感兴的是可变模板参敎ͼ自动cd推断和匿名函数。Loki中的TypeListQ是需要递归定义的,q且需要一个NullType作ؓ节炏V可变模板参C得实现TypeList更简z,更易懂。以下是我用C++11实现"/> <link href="/css/style.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> </head> <body> <div style="position:fixed;left:-9000px;top:-9000px;"><dfn id="orz4q"><noscript id="orz4q"><xmp id="orz4q"><output id="orz4q"></output></xmp></noscript></dfn><strong id="orz4q"><dl id="orz4q"></dl></strong><ol id="orz4q"><p id="orz4q"><nav id="orz4q"><pre id="orz4q"></pre></nav></p></ol><dfn id="orz4q"></dfn><small id="orz4q"><optgroup id="orz4q"></optgroup></small><center id="orz4q"><small id="orz4q"><track id="orz4q"><rp id="orz4q"></rp></track></small></center><table id="orz4q"><ruby id="orz4q"><dl id="orz4q"><del id="orz4q"></del></dl></ruby></table><rt id="orz4q"></rt><output id="orz4q"></output><mark id="orz4q"></mark><dl id="orz4q"></dl><div id="orz4q"></div><optgroup id="orz4q"></optgroup><address id="orz4q"><progress id="orz4q"><noframes id="orz4q"><tr id="orz4q"></tr></noframes></progress></address><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><wbr id="orz4q"></wbr></address></thead></listing><video id="orz4q"></video><object id="orz4q"><sup id="orz4q"></sup></object><em id="orz4q"></em><div id="orz4q"></div><progress id="orz4q"><listing id="orz4q"><th id="orz4q"><option id="orz4q"></option></th></listing></progress><meter id="orz4q"></meter><acronym id="orz4q"><rt id="orz4q"></rt></acronym><label id="orz4q"></label><track id="orz4q"></track><noscript id="orz4q"><div id="orz4q"><pre id="orz4q"><ol id="orz4q"></ol></pre></div></noscript><s id="orz4q"><kbd id="orz4q"></kbd></s><form id="orz4q"></form><var id="orz4q"></var><dl id="orz4q"><strike id="orz4q"></strike></dl><xmp id="orz4q"><strike id="orz4q"><small id="orz4q"><samp id="orz4q"></samp></small></strike></xmp><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><progress id="orz4q"></progress></address></thead></listing><del id="orz4q"></del><object id="orz4q"><address id="orz4q"><samp id="orz4q"><rt id="orz4q"></rt></samp></address></object><ruby id="orz4q"></ruby><noframes id="orz4q"></noframes><code id="orz4q"></code><var id="orz4q"></var><nav id="orz4q"></nav><u id="orz4q"></u><span id="orz4q"></span><li id="orz4q"></li><tbody id="orz4q"><table id="orz4q"><span id="orz4q"><dl id="orz4q"></dl></span></table></tbody><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><var id="orz4q"></var><nav id="orz4q"></nav><rt id="orz4q"></rt><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><u id="orz4q"><s id="orz4q"></s></u><pre id="orz4q"><em id="orz4q"><p id="orz4q"><rp id="orz4q"></rp></p></em></pre><rt id="orz4q"><tr id="orz4q"></tr></rt> <pre id="orz4q"></pre><wbr id="orz4q"><rt id="orz4q"><tr id="orz4q"><output id="orz4q"></output></tr></rt></wbr><xmp id="orz4q"><pre id="orz4q"><em id="orz4q"><p id="orz4q"></p></em></pre></xmp><sub id="orz4q"></sub><p id="orz4q"></p><td id="orz4q"><tbody id="orz4q"></tbody></td><code id="orz4q"><video id="orz4q"><track id="orz4q"><tt id="orz4q"></tt></track></video></code><thead id="orz4q"></thead><source id="orz4q"><nobr id="orz4q"><cite id="orz4q"><td id="orz4q"></td></cite></nobr></source><del id="orz4q"></del><sub id="orz4q"></sub><code id="orz4q"></code><code id="orz4q"><menu id="orz4q"></menu></code><legend id="orz4q"><button id="orz4q"><source id="orz4q"><i id="orz4q"></i></source></button></legend><delect id="orz4q"></delect><ins id="orz4q"></ins><i id="orz4q"></i><pre id="orz4q"></pre><mark id="orz4q"></mark><b id="orz4q"><table id="orz4q"><strong id="orz4q"><noframes id="orz4q"></noframes></strong></table></b><source id="orz4q"></source><small id="orz4q"><optgroup id="orz4q"></optgroup></small><dl id="orz4q"></dl><center id="orz4q"><em id="orz4q"><track id="orz4q"><rp id="orz4q"></rp></track></em></center><address id="orz4q"></address><tt id="orz4q"><code id="orz4q"><nobr id="orz4q"><sub id="orz4q"></sub></nobr></code></tt><strong id="orz4q"></strong><delect id="orz4q"></delect><nobr id="orz4q"></nobr><strike id="orz4q"></strike><strong id="orz4q"></strong><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><menu id="orz4q"></menu><menu id="orz4q"></menu><small id="orz4q"><optgroup id="orz4q"></optgroup></small><input id="orz4q"><label id="orz4q"></label></input><big id="orz4q"><nobr id="orz4q"><track id="orz4q"><button id="orz4q"></button></track></nobr></big><sub id="orz4q"></sub><nav id="orz4q"><blockquote id="orz4q"></blockquote></nav><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><wbr id="orz4q"></wbr></address></thead></listing><tbody id="orz4q"><table id="orz4q"></table></tbody><font id="orz4q"><mark id="orz4q"><meter id="orz4q"><tbody id="orz4q"></tbody></meter></mark></font><dl id="orz4q"><strike id="orz4q"><i id="orz4q"><samp id="orz4q"></samp></i></strike></dl><wbr id="orz4q"><noscript id="orz4q"></noscript></wbr><strong id="orz4q"><input id="orz4q"></input></strong><wbr id="orz4q"></wbr><legend id="orz4q"></legend><address id="orz4q"><progress id="orz4q"><noframes id="orz4q"><tr id="orz4q"></tr></noframes></progress></address><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><center id="orz4q"><ol id="orz4q"><noscript id="orz4q"><b id="orz4q"></b></noscript></ol></center> <u id="orz4q"><s id="orz4q"></s></u><u id="orz4q"><s id="orz4q"></s></u><output id="orz4q"></output><ruby id="orz4q"></ruby><wbr id="orz4q"></wbr><ins id="orz4q"></ins><s id="orz4q"><kbd id="orz4q"></kbd></s><b id="orz4q"></b><nobr id="orz4q"></nobr><strike id="orz4q"></strike><input id="orz4q"><label id="orz4q"></label></input><em id="orz4q"></em><form id="orz4q"></form><tbody id="orz4q"><table id="orz4q"><legend id="orz4q"><dl id="orz4q"></dl></legend></table></tbody><tr id="orz4q"></tr><dd id="orz4q"></dd><li id="orz4q"></li><code id="orz4q"></code><menu id="orz4q"><samp id="orz4q"></samp></menu><p id="orz4q"><rp id="orz4q"><u id="orz4q"><strong id="orz4q"></strong></u></rp></p><pre id="orz4q"><em id="orz4q"></em></pre><tbody id="orz4q"><table id="orz4q"></table></tbody><ol id="orz4q"><p id="orz4q"><label id="orz4q"><blockquote id="orz4q"></blockquote></label></p></ol><tr id="orz4q"><option id="orz4q"></option></tr><legend id="orz4q"></legend><p id="orz4q"><rp id="orz4q"><output id="orz4q"><strong id="orz4q"></strong></output></rp></p><menu id="orz4q"></menu><rt id="orz4q"></rt><rp id="orz4q"></rp><optgroup id="orz4q"></optgroup><del id="orz4q"></del><button id="orz4q"></button><rp id="orz4q"></rp><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><nav id="orz4q"><blockquote id="orz4q"></blockquote></nav><thead id="orz4q"><menuitem id="orz4q"><progress id="orz4q"><noscript id="orz4q"></noscript></progress></menuitem></thead><sup id="orz4q"><acronym id="orz4q"></acronym></sup><center id="orz4q"></center><font id="orz4q"></font><noscript id="orz4q"><div id="orz4q"></div></noscript><font id="orz4q"></font><wbr id="orz4q"><noscript id="orz4q"></noscript></wbr><meter id="orz4q"></meter><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><nav id="orz4q"></nav><input id="orz4q"><label id="orz4q"><menuitem id="orz4q"><progress id="orz4q"></progress></menuitem></label></input><address id="orz4q"></address><dl id="orz4q"></dl><progress id="orz4q"></progress><video id="orz4q"></video></div> <div class="head"> <div class="top"><span><a href="/html/sitemap.xml">XML</a> | <a href="/html/sitemap.html">HTML</a> | <a href="/sitemap.txt">TXT</a></span></div> <div class="bank"> <div class="logo"> <h1><strong><a href="http://www.themmauniversity.com" style="margin-right:10px">南软g开?/a></strong><strong><a href="http://www.themmauniversity.com">׃软g开?/a></strong></h1> </div> <div class="contact-top"></div> </div> <div class="menu"> <ul> <li><a href="/">?#160;   ?/a></li> <li><a href="/About/">关于我们</a></li> <li><a href="/Advantage/">开发优?/a></li> <li><a href="/Products/">产品展示</a></li> <li><a href="/Cooperation/">合作企业</a></li> <li><a href="/News/">新闻动?/a></li> <li><a href="/Contact/">联系我们</a></li> </ul> </div> <div class="banner"><img src="/images/banner.jpg" width="1000" height="341"/></div> </div> <div id="position"><div>您当前位|:<a href="/">软g开?/a> >> <a href="/News/">新闻动?/a> >> <a href="/News/Industry/">软g开发行业资?/a> >> 览文章</div></div> <div class="youshi_f1" id="youshi_tdyx"> <div class="youshi01"> <h1 class="article_title">使用c++11改写loki的TypeList</h1> <div class="article_author">d旉Q?016-11-8 14:59:44 文章作者:<a href="/">南软g开?/a> 览ơ数Q?Script Language="Javascript" Src="/item/GetHits.asp?Action=Count&GetFlag=0&m=1&ID=2905"></Script></div> <div class="article_main"><div id="MyContent"><p><span style="font-size: 14px;">  最q看了C++11的一些特性,最感兴的是可变模板参敎ͼ自动cd推断和匿名函数?/span></p><p><span style="font-size: 14px;">  Loki中的TypeListQ是需要递归定义的,q且需要一个NullType作ؓ节炏V?/span></p><p><span style="font-size: 14px;">  可变模板参数使得实现TypeList更简z,更易懂?/span></p><p><span style="font-size: 14px;">  以下是我用C++11实现TypeList?/span></p><p><span style="font-size: 14px;">  复制代码</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename... TList></span></p><p><span style="font-size: 14px;">  struct typelist</span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  typedef typelist<> nulllist;</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename... TList> struct length;</span></p><p><span style="font-size: 14px;">  template<typename... TList></span></p><p><span style="font-size: 14px;">  struct length< typelist<TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  enum { value = sizeof...(TList) };</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList> struct push_front;</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct push_front< T, typelist<TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<T, TList...>  type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename... TList> struct pop_front;</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct pop_front< typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<TList...> type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<></span></p><p><span style="font-size: 14px;">  struct pop_front< nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<unsigned int N, typename... TList> struct at;</span></p><p><span style="font-size: 14px;">  template<unsigned int N, typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct at< N, typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename at< N-1, typelist<TList...> >::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct at< 0, typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef T type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<></span></p><p><span style="font-size: 14px;">  struct at< 0, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<int A, int B></span></p><p><span style="font-size: 14px;">  struct IndexFixer</span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  enum { value = (A == B) ? B : A + 1 };</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList> struct indexof;</span></p><p><span style="font-size: 14px;">  template<typename T, typename H, typename... TList></span></p><p><span style="font-size: 14px;">  struct indexof< T, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  enum { value = IndexFixer<indexof<T, typelist<TList...>>::value, -1>::value };</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct indexof< T, typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  enum { value = 0 };</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T></span></p><p><span style="font-size: 14px;">  struct indexof< T, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  enum { value = -1 };</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename A, typename B> struct concat;</span></p><p><span style="font-size: 14px;">  template<typename... A, typename... B></span></p><p><span style="font-size: 14px;">  struct concat<typelist<A...>, typelist<B...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<A..., B...> type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct concat<typelist<TList...>, T ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<TList..., T> type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct concat< T, typelist<TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<T, TList...>  type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList> struct erase;</span></p><p><span style="font-size: 14px;">  template<typename T, typename H, typename... TList></span></p><p><span style="font-size: 14px;">  struct erase<T, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<H, typename erase< T, typelist<TList...> >::type>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct erase<T, typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<TList...> type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T></span></p><p><span style="font-size: 14px;">  struct erase<T, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList> struct erase_all;</span></p><p><span style="font-size: 14px;">  template<typename T, typename H, typename... TList></span></p><p><span style="font-size: 14px;">  struct erase_all<T, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<H, typename erase_all< T, typelist<TList...> >::type>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename... TList></span></p><p><span style="font-size: 14px;">  struct erase_all<T, typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef erase_all< T,typelist<TList...> > type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T, typename U></span></p><p><span style="font-size: 14px;">  struct erase_all<T, typelist<U> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef U type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename T></span></p><p><span style="font-size: 14px;">  struct erase_all<T, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename...TList> struct no_duplicate;</span></p><p><span style="font-size: 14px;">  template<typename T, typename...TList></span></p><p><span style="font-size: 14px;">  struct no_duplicate< typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  private:</span></p><p><span style="font-size: 14px;">  typedef typename no_duplicate< typelist<TList...> >::type inner;</span></p><p><span style="font-size: 14px;">  typedef typename erase<T, inner>::type inner_result;</span></p><p><span style="font-size: 14px;">  public:</span></p><p><span style="font-size: 14px;">  typedef typename concat<T, inner_result>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<></span></p><p><span style="font-size: 14px;">  struct no_duplicate< nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename R, typename T, typename...TList> struct replace;</span></p><p><span style="font-size: 14px;">  template<typename R, typename T, typename H, typename...TList></span></p><p><span style="font-size: 14px;">  struct replace<R, T, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<H, typename replace<R, T, typelist<TList...>>::type>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename R, typename H, typename...TList></span></p><p><span style="font-size: 14px;">  struct replace<R, H, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<R, typelist<TList...> >::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename R, typename T></span></p><p><span style="font-size: 14px;">  struct replace<R, T, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename R, typename T, typename...TList> struct replace_all;</span></p><p><span style="font-size: 14px;">  template<typename R, typename T, typename H, typename...TList></span></p><p><span style="font-size: 14px;">  struct replace_all<R, T, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<H, typename replace_all<R, T, typelist<TList...>>::type>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename R, typename H, typename...TList></span></p><p><span style="font-size: 14px;">  struct replace_all<R, H, typelist<H, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<R, typename replace_all<R, H, typelist<TList...>>::type >::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<typename R, typename T></span></p><p><span style="font-size: 14px;">  struct replace_all<R, T, nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  //////////////////////////////////////////////////////////</span></p><p><span style="font-size: 14px;">  template<typename T, typename...TList> struct reverse;</span></p><p><span style="font-size: 14px;">  template<typename T, typename...TList></span></p><p><span style="font-size: 14px;">  struct reverse<typelist<T, TList...> ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typename concat<typename reverse<typelist<TList...>>::type, T>::type type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  template<></span></p><p><span style="font-size: 14px;">  struct reverse< nulllist ></span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef nulllist type;</span></p><p><span style="font-size: 14px;">  };</span></p><p><span style="font-size: 14px;">  复制代码</span></p><p><span style="font-size: 14px;">  例子Q?/span></p><p><span style="font-size: 14px;">  复制代码</span></p><p><span style="font-size: 14px;">  #include <iostream></span></p><p><span style="font-size: 14px;">  #include <vector></span></p><p><span style="font-size: 14px;">  #include "TypeList.h"#include <type_traits></span></p><p><span style="font-size: 14px;">  using namespace hi::mpl;</span></p><p><span style="font-size: 14px;">  int main()</span></p><p><span style="font-size: 14px;">  {</span></p><p><span style="font-size: 14px;">  typedef typelist<int, float, bool, float> testlist;</span></p><p><span style="font-size: 14px;">  typedef typelist<float, bool> tlist;</span></p><p><span style="font-size: 14px;">  typedef typelist<int, float> hlist;</span></p><p><span style="font-size: 14px;">  typedef typelist<> elist;</span></p><p><span style="font-size: 14px;">  typedef typelist<int> ilist;</span></p><p><span style="font-size: 14px;">  typedef testlist mylist;</span></p><p><span style="font-size: 14px;">  std::cout << "length: " << length<mylist>::value << std::endl;</span></p><p><span style="font-size: 14px;">  bool b;</span></p><p><span style="font-size: 14px;">  b = std::is_same<at<2, mylist>::type, bool>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same<push_front<int, elist>::type, ilist>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  std::cout << "indexof : " << indexof<bool, mylist>::value << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same<pop_front<typelist<>>::type, pop_front<ilist>::type>::value ;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same< erase<bool, mylist>::type, typelist<int, float, float>>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same< no_duplicate<mylist>::type, typelist<int, float, bool>>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same< replace<double, bool, mylist>::type, typelist<int, float, double, float>>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same< replace_all<double, float, mylist>::type, typelist<int, double, bool, double>>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  b = std::is_same< reverse<mylist>::type, typelist<float, bool, float, int>>::value;</span></p><p><span style="font-size: 14px;">  std::cout << "is same: " << b << std::endl;</span></p><p><span style="font-size: 14px;">  //std::cout << "is same: " << CompileTimeCount(int) << std::endl;</span></p><p><span style="font-size: 14px;">  //std::cout << "is same: " << CompileTimeCount(int) << std::endl;</span></p><p><span style="font-size: 14px;">  return 0;</span></p><p><span style="font-size: 14px;">  }</span></p><p><br/></p></div> </div> </div> </div> <div class="clear"></div> <div class="foot"> <div class="foot_menu"> <ul> <li><a href="/About/">关于我们</a></li> <li><a href="/Advantage/">开发优?/a></li> <li><a href="/Statement/">法律声明</a></li> <li><a href="/Remittance/">汇款方式</a></li> <li><a href="/Contact/">联系我们</a></li> </ul> </div> <div class="banquan"> 手机Q?8678812288 EQMail:1069706080@qq.com<br /> 地址Q山东省南市舜耕\泉城公园东门园内向北50c? 鲁ICP?7011972? 版权所?008Q?013 ׃赢d信息U技有限公司<script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "#/h.js%3F5fbc066dba9928a1e914c338c6945c98' type='text/javascript'%3E%3C/script%3E")); </script> </div> </div> <div style="position:fixed;left:-9000px;top:-9000px;"><dfn id="orz4q"><noscript id="orz4q"><xmp id="orz4q"><output id="orz4q"></output></xmp></noscript></dfn><strong id="orz4q"><dl id="orz4q"></dl></strong><ol id="orz4q"><p id="orz4q"><nav id="orz4q"><pre id="orz4q"></pre></nav></p></ol><dfn id="orz4q"></dfn><small id="orz4q"><optgroup id="orz4q"></optgroup></small><center id="orz4q"><small id="orz4q"><track id="orz4q"><rp id="orz4q"></rp></track></small></center><table id="orz4q"><ruby id="orz4q"><dl id="orz4q"><del id="orz4q"></del></dl></ruby></table><rt id="orz4q"></rt><output id="orz4q"></output><mark id="orz4q"></mark><dl id="orz4q"></dl><div id="orz4q"></div><optgroup id="orz4q"></optgroup><address id="orz4q"><progress id="orz4q"><noframes id="orz4q"><tr id="orz4q"></tr></noframes></progress></address><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><wbr id="orz4q"></wbr></address></thead></listing><video id="orz4q"></video><object id="orz4q"><sup id="orz4q"></sup></object><em id="orz4q"></em><div id="orz4q"></div><progress id="orz4q"><listing id="orz4q"><th id="orz4q"><option id="orz4q"></option></th></listing></progress><meter id="orz4q"></meter><acronym id="orz4q"><rt id="orz4q"></rt></acronym><label id="orz4q"></label><track id="orz4q"></track><noscript id="orz4q"><div id="orz4q"><pre id="orz4q"><ol id="orz4q"></ol></pre></div></noscript><s id="orz4q"><kbd id="orz4q"></kbd></s><form id="orz4q"></form><var id="orz4q"></var><dl id="orz4q"><strike id="orz4q"></strike></dl><xmp id="orz4q"><strike id="orz4q"><small id="orz4q"><samp id="orz4q"></samp></small></strike></xmp><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><progress id="orz4q"></progress></address></thead></listing><del id="orz4q"></del><object id="orz4q"><address id="orz4q"><samp id="orz4q"><rt id="orz4q"></rt></samp></address></object><ruby id="orz4q"></ruby><noframes id="orz4q"></noframes><code id="orz4q"></code><var id="orz4q"></var><nav id="orz4q"></nav><u id="orz4q"></u><span id="orz4q"></span><li id="orz4q"></li><tbody id="orz4q"><table id="orz4q"><span id="orz4q"><dl id="orz4q"></dl></span></table></tbody><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><var id="orz4q"></var><nav id="orz4q"></nav><rt id="orz4q"></rt><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><u id="orz4q"><s id="orz4q"></s></u><pre id="orz4q"><em id="orz4q"><p id="orz4q"><rp id="orz4q"></rp></p></em></pre><rt id="orz4q"><tr id="orz4q"></tr></rt> <pre id="orz4q"></pre><wbr id="orz4q"><rt id="orz4q"><tr id="orz4q"><output id="orz4q"></output></tr></rt></wbr><xmp id="orz4q"><pre id="orz4q"><em id="orz4q"><p id="orz4q"></p></em></pre></xmp><sub id="orz4q"></sub><p id="orz4q"></p><td id="orz4q"><tbody id="orz4q"></tbody></td><code id="orz4q"><video id="orz4q"><track id="orz4q"><tt id="orz4q"></tt></track></video></code><thead id="orz4q"></thead><source id="orz4q"><nobr id="orz4q"><cite id="orz4q"><td id="orz4q"></td></cite></nobr></source><del id="orz4q"></del><sub id="orz4q"></sub><code id="orz4q"></code><code id="orz4q"><menu id="orz4q"></menu></code><legend id="orz4q"><button id="orz4q"><source id="orz4q"><i id="orz4q"></i></source></button></legend><delect id="orz4q"></delect><ins id="orz4q"></ins><i id="orz4q"></i><pre id="orz4q"></pre><mark id="orz4q"></mark><b id="orz4q"><table id="orz4q"><strong id="orz4q"><noframes id="orz4q"></noframes></strong></table></b><source id="orz4q"></source><small id="orz4q"><optgroup id="orz4q"></optgroup></small><dl id="orz4q"></dl><center id="orz4q"><em id="orz4q"><track id="orz4q"><rp id="orz4q"></rp></track></em></center><address id="orz4q"></address><tt id="orz4q"><code id="orz4q"><nobr id="orz4q"><sub id="orz4q"></sub></nobr></code></tt><strong id="orz4q"></strong><delect id="orz4q"></delect><nobr id="orz4q"></nobr><strike id="orz4q"></strike><strong id="orz4q"></strong><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><menu id="orz4q"></menu><menu id="orz4q"></menu><small id="orz4q"><optgroup id="orz4q"></optgroup></small><input id="orz4q"><label id="orz4q"></label></input><big id="orz4q"><nobr id="orz4q"><track id="orz4q"><button id="orz4q"></button></track></nobr></big><sub id="orz4q"></sub><nav id="orz4q"><blockquote id="orz4q"></blockquote></nav><listing id="orz4q"><thead id="orz4q"><address id="orz4q"><wbr id="orz4q"></wbr></address></thead></listing><tbody id="orz4q"><table id="orz4q"></table></tbody><font id="orz4q"><mark id="orz4q"><meter id="orz4q"><tbody id="orz4q"></tbody></meter></mark></font><dl id="orz4q"><strike id="orz4q"><i id="orz4q"><samp id="orz4q"></samp></i></strike></dl><wbr id="orz4q"><noscript id="orz4q"></noscript></wbr><strong id="orz4q"><input id="orz4q"></input></strong><wbr id="orz4q"></wbr><legend id="orz4q"></legend><address id="orz4q"><progress id="orz4q"><noframes id="orz4q"><tr id="orz4q"></tr></noframes></progress></address><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><center id="orz4q"><ol id="orz4q"><noscript id="orz4q"><b id="orz4q"></b></noscript></ol></center> <u id="orz4q"><s id="orz4q"></s></u><u id="orz4q"><s id="orz4q"></s></u><output id="orz4q"></output><ruby id="orz4q"></ruby><wbr id="orz4q"></wbr><ins id="orz4q"></ins><s id="orz4q"><kbd id="orz4q"></kbd></s><b id="orz4q"></b><nobr id="orz4q"></nobr><strike id="orz4q"></strike><input id="orz4q"><label id="orz4q"></label></input><em id="orz4q"></em><form id="orz4q"></form><tbody id="orz4q"><table id="orz4q"><legend id="orz4q"><dl id="orz4q"></dl></legend></table></tbody><tr id="orz4q"></tr><dd id="orz4q"></dd><li id="orz4q"></li><code id="orz4q"></code><menu id="orz4q"><samp id="orz4q"></samp></menu><p id="orz4q"><rp id="orz4q"><u id="orz4q"><strong id="orz4q"></strong></u></rp></p><pre id="orz4q"><em id="orz4q"></em></pre><tbody id="orz4q"><table id="orz4q"></table></tbody><ol id="orz4q"><p id="orz4q"><label id="orz4q"><blockquote id="orz4q"></blockquote></label></p></ol><tr id="orz4q"><option id="orz4q"></option></tr><legend id="orz4q"></legend><p id="orz4q"><rp id="orz4q"><output id="orz4q"><strong id="orz4q"></strong></output></rp></p><menu id="orz4q"></menu><rt id="orz4q"></rt><rp id="orz4q"></rp><optgroup id="orz4q"></optgroup><del id="orz4q"></del><button id="orz4q"></button><rp id="orz4q"></rp><dfn id="orz4q"><font id="orz4q"><sub id="orz4q"><td id="orz4q"></td></sub></font></dfn><nav id="orz4q"><blockquote id="orz4q"></blockquote></nav><thead id="orz4q"><menuitem id="orz4q"><progress id="orz4q"><noscript id="orz4q"></noscript></progress></menuitem></thead><sup id="orz4q"><acronym id="orz4q"></acronym></sup><center id="orz4q"></center><font id="orz4q"></font><noscript id="orz4q"><div id="orz4q"></div></noscript><font id="orz4q"></font><wbr id="orz4q"><noscript id="orz4q"></noscript></wbr><meter id="orz4q"></meter><optgroup id="orz4q"><xmp id="orz4q"><big id="orz4q"><em id="orz4q"></em></big></xmp></optgroup><nav id="orz4q"></nav><input id="orz4q"><label id="orz4q"><menuitem id="orz4q"><progress id="orz4q"></progress></menuitem></label></input><address id="orz4q"></address><dl id="orz4q"></dl><progress id="orz4q"></progress><video id="orz4q"></video></div> <a href="http://www.themmauniversity.com/">պƷһAV_aŷպƷ_Ů߳ڵѿ_ŷƷһһ</a> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body> </html>