08/10/03 08:59:29
>>623
いや、試してないけど実装はたったこれだけで良いっぽいよ。
// remove_const : const修飾の除去
//非constが渡されたらこれが実体化
template <typename Type>
struct remove_const {
typedef Type type;
};
//constの場合はこちらが実体化
template <typename Type>
struct remove_const<Type const> {
typedef Type type;
};
//用例
remove_const<const int>::type i; //constが外れる