亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? interoperability-revisited.rst

?? Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work
?? RST
字號:
++++++++++++++++++++++++++++ Interoperability Revisited ++++++++++++++++++++++++++++:date: $Date: 2008-03-22 17:45:55 -0400 (Sat, 22 Mar 2008) $:copyright: Copyright Thomas Witt 2004... Distributed under the Boost.. Software License, Version 1.0. (See accompanying.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)Problem=======The current iterator_facade specification makes it unneccessarily tedious toimplement interoperable iterators.In the following text a simplified example of the current iterator_facade specification is used toillustrate the problem.In the current specification binary operators are implemented in the following way::  template <class Derived>  struct Facade  {  };  template <class T1, T2>  struct is_interoperable :    or_<          is_convertible<T1, T2>       , is_convertible<T2, T1>    >   {};  template<      class Derived1    , class Derived2  >  enable_if<is_interoperable<Derived1, Derived2>, bool> operator==(      Derived1 const& lhs    , Derived2 const& rhs  )  {    return static_cast<Derived1 const&>(lhs).equal_to(static_cast<Derived2 const&(rhs));  } The problem with this is that operator== always forwards to Derived1::equal_to. The net effect is that thefollowing "obvious" implementation of to interoperable types doesnot quite work. ::  struct Mutable : Facade<Mutable>  {    bool equal_to(Mutable const&);    };  struct Constant : Facade<Constant>  {    Constant();    Constant(Constant const&);    Constant(Mutable const&);    ...    bool equal_to(Constant const&);    };  Constant c;  Mutable  m;  c == m; // ok, dispatched to Constant::equal_to  m == c; // !! error, dispatched to Mutable::equal_to  Instead the following "slightly" more complicated implementation is necessary  struct Mutable : Facade<Mutable>  {    template <class T>    enable_if<is_convertible<Mutable, T> || is_convertible<T, Mutable>, bool>::type equal_to(T const&);    };  struct Constant : Tag<Constant>  {    Constant();    Constant(Constant const&);    Constant(Mutable const&);    template <class T>    enable_if<is_convertible<Constant, T> || is_convertible<T, Constant>, bool>::type equal_to(T const&);    };Beside the fact that the code is significantly more complex to understand and to teach there isa major design problem lurking here. Note that in both types equal_to is a function template with an unconstrained argument T. This is necessary so that further types can be made interoperable withMutable or Constant. Would Mutable be defined as   ::  struct Mutable : Facade<Mutable>  {    bool equal_to(Mutable const&);      bool equal_to(Constant const&);    };Constant and Mutable would still be interoperable but no further interoperable could be added without changing Mutable. Even if this would be considered acceptable the current specification forcesa two way dependency between interoperable types. Note in the templated equal_to case this dependency is implicitly created when specializing equal_to.Solution========The two way dependency can be avoided by enabling type conversion in the binary operatorimplementation. Note that this is the usual way interoperability betwween types is achievedfor binary operators and one reason why binary operators are usually implemented as non-members.A simple implementation of this strategy would look like this ::  template<      class T1    , class T2  >  struct interoperable_base :      if_<           is_convertible<              T2            , T1          >        , T1        , T2>  {};  template<      class Derived1    , class Derived2  >  enable_if<is_interoperable<Derived1, Derived2>, bool> operator==(      Derived1 const& lhs    , Derived2 const& rhs  )  {    typedef interoperable_base<                Derived1              , Derived2            >::type Base;    return static_cast<Base const&>(lhs).equal_to(static_cast<Derived2 const&(rhs));  } This way our original simple and "obvious" implementation wouldwork again. ::  c == m; // ok, dispatched to Constant::equal_to  m == c; // ok, dispatched to Constant::equal_to, m converted to ConstantThe backdraw of this approach is that a possibly costly conversion of iterator objectsis forced on the user even in cases where direct comparison could be implementedin a much more efficient way. This problem arises especially for iterator_adaptorspecializations and can be significantly slow down the iteration over ranges. Given the factthat iteration is a very basic operation this possible performance degradation is not acceptable.Luckily whe can have our cake and eat it by a slightly more clever implementation of the binary operators. ::  template<      class Derived1    , class Derived2  >  enable_if<is_convertible<Derived2, Derived1>, bool> operator==(      Derived1 const& lhs    , Derived2 const& rhs  )  {    return static_cast<Derived1 const&>(lhs).equal_to(static_cast<Derived2 const&(rhs));  }   template<      class Derived1    , class Derived2  >  enable_if<is_convertible<Derived1, Derived2>, bool> operator==(      Derived1 const& lhs    , Derived2 const& rhs  )  {    return static_cast<Derived2 const&>(rhs).equal_to(static_cast<Derived1 const&(lhs));  } Given our simple and obvious definition of Mutable and Constant nothing has changed yet. ::  c == m; // ok, dispatched to Constant::equal_to, m converted to Constant  m == c; // ok, dispatched to Constant::equal_to, m converted to ConstantBut now the user can avoid the type conversion by supplying theappropriate overload in Constant ::   struct Constant : Facade<Constant>  {    Constant();    Constant(Constant const&);    Constant(Mutable const&);    ...    bool equal_to(Constant const&);      bool equal_to(Mutable const&);    };  c == m; // ok, dispatched to Constant::equal_to(Mutable const&), no conversion  m == c; // ok, dispatched to Constant::equal_to(Mutable const&), no conversionThis definition of operator== introduces a possible ambiguity when both types are convertibleto each other. I don't think this is a problem as this behaviour is the same with concrete types.I.e.  ::  struct A {};  bool operator==(A, A);  struct B { B(A); };   bool operator==(B, B);  A a;  B b(a);  a == b; // error, ambiguous overloadEffect======Iterator implementations using iterator_facade look exactly as if they were"hand-implemented" (I am working on better wording).a) Less burden for the userb) The definition (standardese) of specialized adpters might be easier    (This has to be proved yet)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色综合| 韩国女主播成人在线| av中文字幕在线不卡| 久久久综合九色合综国产精品| 日韩福利电影在线观看| 欧美日韩精品一区二区天天拍小说| 亚洲欧美日韩国产综合在线| 成人黄色av电影| 午夜精品在线看| 国产精品久久久99| 春色校园综合激情亚洲| 欧美国产一区二区在线观看 | 亚洲视频一区二区在线| 波波电影院一区二区三区| 中文字幕的久久| 99视频一区二区| 亚洲人123区| 日本韩国精品一区二区在线观看| 亚洲丝袜另类动漫二区| 97se亚洲国产综合自在线观| 亚洲视频一区二区在线观看| 色婷婷综合久久久久中文 | 亚洲精品免费一二三区| 91九色02白丝porn| 亚洲国产乱码最新视频 | 色综合久久综合网97色综合| 一区二区久久久久久| 欧美日韩精品欧美日韩精品一综合| 天堂在线亚洲视频| 欧美一区二区三区男人的天堂| 奇米色一区二区| 久久久久久久久久电影| 成人美女视频在线看| 亚洲卡通动漫在线| 欧美三级在线看| 美女视频黄久久| 亚洲国产成人自拍| 色激情天天射综合网| 亚洲成a人片在线观看中文| 欧美一区二区三区四区在线观看| 麻豆91在线看| 国产精品久久精品日日| 欧美综合一区二区| 麻豆视频观看网址久久| 中文字幕久久午夜不卡| 欧美在线一二三四区| 蜜桃视频第一区免费观看| 久久精品水蜜桃av综合天堂| 99re这里都是精品| 日本亚洲免费观看| 国产色一区二区| 欧美在线短视频| 国内精品视频一区二区三区八戒| 一区在线观看视频| 7777精品伊人久久久大香线蕉完整版 | 一区二区三区四区不卡在线| 欧美日韩国产片| 国产一区二区日韩精品| 日韩理论电影院| 欧美一级午夜免费电影| 成人h精品动漫一区二区三区| 伊人色综合久久天天| 日韩欧美电影在线| 色综合久久88色综合天天免费| 免费精品视频在线| 亚洲欧洲av另类| 日韩视频中午一区| 91免费国产视频网站| 美女脱光内衣内裤视频久久影院| 久久久五月婷婷| 在线免费亚洲电影| 国产高清亚洲一区| 调教+趴+乳夹+国产+精品| 国产午夜一区二区三区| 欧美日韩久久不卡| av亚洲精华国产精华| 日韩综合在线视频| 最近日韩中文字幕| 久久综合九色综合欧美亚洲| 欧美亚洲另类激情小说| 国产电影精品久久禁18| 丝袜美腿一区二区三区| 亚洲国产岛国毛片在线| 欧美一区二区在线免费观看| av资源站一区| 国产一区二区三区香蕉| 午夜精品视频在线观看| 国产精品成人一区二区三区夜夜夜| 日韩美女一区二区三区| 欧美性三三影院| 99在线精品观看| 国产一区二区三区免费在线观看| 午夜精品一区二区三区免费视频 | 99免费精品在线观看| 精品在线观看视频| 午夜婷婷国产麻豆精品| 亚洲欧美福利一区二区| 久久久久久久久99精品| 日韩免费在线观看| 欧美人妖巨大在线| 91黄色免费版| 91视频你懂的| 成人免费精品视频| 国产精品一区专区| 天天综合色天天综合色h| 欧美电影免费观看高清完整版在| 在线观看不卡视频| 99在线精品观看| 成人影视亚洲图片在线| 久草在线在线精品观看| 肉丝袜脚交视频一区二区| 一区二区三区四区激情| 最新久久zyz资源站| 久久精品日产第一区二区三区高清版| 91精品国产高清一区二区三区蜜臀| 色999日韩国产欧美一区二区| 成人sese在线| 北条麻妃国产九九精品视频| 国产精品一区二区三区网站| 韩国精品免费视频| 久久精品国产77777蜜臀| 日韩精品一二三四| 日韩精品亚洲专区| 日韩av在线发布| 天堂va蜜桃一区二区三区漫画版| 亚洲一区二区3| 亚洲一级片在线观看| 亚洲精品国产a| 亚洲精品国产高清久久伦理二区 | 久久久91精品国产一区二区精品 | 国产成人自拍在线| 国产99一区视频免费| 国产精品一区二区无线| 国产成人午夜视频| 成人午夜在线免费| av电影天堂一区二区在线| 成人黄色在线看| 91在线无精精品入口| 91香蕉视频污在线| 色狠狠一区二区| 欧美日韩国产精品成人| 欧美喷潮久久久xxxxx| 欧美福利电影网| 日韩一区二区三区视频在线| 日韩欧美综合一区| 久久日韩精品一区二区五区| 久久在线免费观看| 国产视频在线观看一区二区三区 | 久久激情五月激情| 激情综合一区二区三区| 亚洲免费毛片网站| 亚洲一区二区三区视频在线| 午夜久久福利影院| 麻豆成人91精品二区三区| 国产麻豆视频一区| 91香蕉视频污在线| 欧美三级日韩三级| 日韩丝袜美女视频| 国产日韩影视精品| 亚洲美女淫视频| 日韩制服丝袜av| 久久疯狂做爰流白浆xx| 国产高清不卡一区二区| 色呦呦一区二区三区| 欧美日韩视频在线第一区| 日韩一区二区三区观看| 国产亲近乱来精品视频 | 亚洲综合在线视频| 蜜臀va亚洲va欧美va天堂| 国产精品一区二区你懂的| av中文字幕不卡| 欧美男男青年gay1069videost| 精品久久久久久最新网址| 中文成人综合网| 亚洲电影第三页| 国产一区二区0| 日本高清免费不卡视频| 日韩欧美一级片| 国产精品白丝在线| 日本欧美在线看| av一区二区三区四区| 56国语精品自产拍在线观看| 久久精品网站免费观看| 一区二区国产视频| 韩国av一区二区三区四区| 一本色道a无线码一区v| 日韩精品一区二区三区在线观看| 国产精品欧美久久久久一区二区| 亚洲成人自拍网| 国产精品亚洲午夜一区二区三区| 欧洲一区在线观看| 久久青草国产手机看片福利盒子| 亚洲精品视频在线观看免费| 蓝色福利精品导航| 91蝌蚪porny| 精品电影一区二区| 亚洲精品国产高清久久伦理二区| 国产一区二区精品久久| 欧美最猛黑人xxxxx猛交| 久久精品亚洲精品国产欧美kt∨|