Bagikan melalui


allocator<void> Kelas

Spesialisasi alokator templat kelas untuk mengetik void, menentukan jenis yang masuk akal dalam konteks ini.

Sintaks

template <>
class allocator<void> {
    typedef void *pointer;
    typedef const void *const_pointer;
    typedef void value_type;
    template <class Other>
    struct rebind;
    allocator();
    allocator(const allocator<void>&);

    template <class Other>
    allocator(const allocator<Other>&);

    template <class Other>
    allocator<void>& operator=(const allocator<Other>&);
};

Keterangan

Kelas secara eksplisit mengkhususkan alokator templat kelas untuk jenis void. Konstruktor dan operator penugasannya berperilaku sama seperti untuk templat kelas, tetapi hanya mendefinisikan jenis berikut:

  • const_pointer.

  • penunjuk.

  • value_type.

  • rebind, templat kelas berlapis.