[過去ログ] Boost総合スレ part7 (989レス)
上下前次1-新
抽出解除 レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
583(4): デフォルトの名無しさん [sage] 2009/05/16(土) 21:42:54 AAS
class rational :
less_than_comparable < rational<IntType
equality_comparable < rational<IntType
less_than_comparable2 < rational<IntType IntType,
equality_comparable2 < rational<IntType IntType,
addable < rational<IntType
subtractable < rational<IntType
multipliable < rational<IntType
dividable < rational<IntType
addable2 < rational<IntType IntType,
subtractable2 < rational<IntType IntType,
subtractable2_left < rational<IntType IntType,
multipliable2 < rational<IntType IntType,
dividable2 < rational<IntType IntType,
dividable2_left < rational<IntType IntType,
incrementable < rational<IntType
decrementable < rational<IntType>
> > > > > > > > > > > > > > > >
ってrationalの定義にあるんだが、これは何??
もしかしてこうするとEmpty Base Optimizationが働くとか!?
584(1): デフォルトの名無しさん [sage] 2009/05/16(土) 21:49:22 AAS
>>583
Boost::operatorで自明な演算子定義を省略してるんだろ
こうしとけば+=があれば+は勝手に実装される
586: 583 [sage] 2009/05/16(土) 22:05:31 AAS
>>584
ああ、Boost.Operatorsライブラリはしってるんだけど、
このテンプレートにテンプレートを重ねる変態的記法に驚いたのだ。
で、「Empty Base Optimizationが働くとか!?」と思った。
587: 583 [sage] 2009/05/16(土) 22:06:53 AAS
つまり普通だったらprivateの多重継承を考えるじゃない。
それを使わず、テンプレートにテンプレートを食わせてるじゃん。
589: 583 [sage] 2009/05/16(土) 22:30:46 AAS
ありがとう。
やっぱEmpty Base Optimizationね。
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.027s