[過去ログ] Boostを語れゴラァ part3 (1001レス)
前次1-
抽出解除 レス栞

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
462
(1): 2006/12/16(土)12:19 AAS
Tはテンプレート引数でコンテナ型です。

typedef typename boost::mpl::if_<boost::is_const<T typename T::const_iterator, typename T::iterator>::type Hoge;
typedef typename boost::mpl::if_<boost::is_const<T typename T::const_pointer, typename T::pointer>::type Hage;
typedef typename boost::mpl::if_<boost::is_const<T typename T::const_reference, typename T::reference>::type Debu;

こういうことをやりたいんですが、もっとシンプルに記述できる方法はないでしょうか?
464
(1): 2006/12/17(日)17:28 AAS
>>462
boost::range_result_iterator< std::vector< int > >::type         // -> std::vector< int >::iterator
boost::range_result_iterator< const std::vector< int > >::type // -> std::vector< int >::const_iterator

あとは上のように獲得した iterator 型に boost::iterator_[reference|pointer] を適用
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ

ぬこの手 ぬこTOP 0.027s