std::allocator
construct
およびdestroy
メンバー関数は、構築する要素の型でパラメーター化されます。
template<class T>
class allocator
{
public:
typedef T value_type;
typedef T* pointer;
template<class U, class... Args>
void construct(U *p, Args&&... args);
template<class U>
void destroy(U *p);
...
};
これの根拠は何ですか?なぜ彼らはどちらかを取らないのですvalue_type*
かpointer
?allocator<T>
type のオブジェクトを構築または破棄する方法のみを知っている必要があるようT
です。