hamigaki.png

前のページ 上に戻る ホーム 次のページ

Struct template member_access_traits

hamigaki::member_access_traits —

cv修飾のメンバ変数への伝播を模倣する

Synopsis

template<typename T, typename U> 
struct member_access_traits {
  // types
  typedef U               value_type;
  typedef /* see below */ reference; 
  typedef /* see below */ pointer;   
};

Description

メンバの意味は次の通り。

メンバ 説明
member_access_traits<T, U>::value_type U
member_access_traits<T, U>::reference Tのオブジェクトから型Uのメンバへアクセスした場合の参照型
member_access_traits<T, U>::pointer Tのオブジェクトから型Uのメンバへアクセスした場合のポインタ型

referencepointerは次のようになる。

T U reference pointer
foo bar bar& bar*
const foo bar const bar& const bar*
const foo bar& bar& bar*
foo const bar const bar& const bar*
volatile foo const bar const volatile bar& const volatile bar*

製作著作 © 2006, 2007 Takeshi Mouri

前のページ 上に戻る ホーム 次のページ