Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #71206

Re: Wading through template instantiation errors for allocator

From Bo Persson <bo@bo-persson.se>
Newsgroups comp.lang.c++
Subject Re: Wading through template instantiation errors for allocator
Date 2020-01-07 15:27 +0100
Message-ID <h7jiqfFbh1rU1@mid.individual.net> (permalink)
References <2925c440-1188-48ff-b931-243234719891@googlegroups.com> <83YQF.3544$GFe.3051@fx12.am4> <ehYQF.7163$Arx.4170@fx08.am4> <GoYQF.2794$OEe.1962@fx15.am4> <qv1k2j$5lt$1@news.albasani.net>

Show all headers | View raw


On 2020-01-07 at 10:47, Bonita Montero wrote:
>>>>> My GNU C++ compiler version 7.4.0 for Ubuntu won't compile the 
>>>>> following code and I don't know why.
> 
>>>> Because allocator has only one template parameter and that's expected.
>>>> As I see it.
> 
>>> And you need rebind if allocator has additional arguments...
> 
>> add this:
>> template <class U> struct rebind{ typedef StaticAllocator<U,capacity> 
>> other; };
> 
> The rebind-member of an allocator is deprecated in C++17 and removed in
> C++20. You would have to specialize std::allocator_traits<youralloc> for
> your own allocator. I don't like this because having a own rebind-member
> results in writing less code.

It is only removed from the std::allocator (where it is no longer needed 
now that we also have std::allocator_traits), but it is still an 
optional part of the allocator interface.


https://en.cppreference.com/w/cpp/named_req/Allocator



     Bo Persson

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-03 07:04 -0800
  Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-03 16:57 +0000
  Re: Wading through template instantiation errors for allocator Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-03 21:32 +0200
    Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-04 06:12 -0800
      Re: Wading through template instantiation errors for allocator Bo Persson <bo@bo-persson.se> - 2020-01-04 15:53 +0100
        Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-04 14:34 -0800
          Re: Wading through template instantiation errors for allocator Manfred <noname@add.invalid> - 2020-01-05 22:31 +0100
  Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-06 02:12 -0800
    Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-06 23:52 -0800
  Re: Wading through template instantiation errors for allocator Ian Collins <ian-news@hotmail.com> - 2020-01-07 21:15 +1300
    Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-07 01:01 -0800
      Re: Wading through template instantiation errors for allocator Ian Collins <ian-news@hotmail.com> - 2020-01-08 07:31 +1300
        Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 19:50 +0100
        Re: Wading through template instantiation errors for allocator Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-01-10 07:06 -0800
          Re: Wading through template instantiation errors for allocator Frederick Gotham <cauldwell.thomas@gmail.com> - 2020-01-14 02:25 -0800
    Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 09:20 +0000
    Re: Wading through template instantiation errors for allocator boltar@nowhere.org - 2020-01-08 10:12 +0000
    Re: Wading through template instantiation errors for allocator Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-01-08 09:22 -0800
      Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-08 17:44 +0000
      Re: Wading through template instantiation errors for allocator "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2020-01-08 23:00 +0100
    Re: Wading through template instantiation errors for allocator Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-01-10 06:48 -0800
  Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 09:20 +0000
    Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 09:35 +0000
      Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 09:43 +0000
        Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 10:47 +0100
          Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 10:59 +0100
            Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 10:15 +0000
              Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 11:21 +0100
                Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 10:25 +0000
          Re: Wading through template instantiation errors for allocator Melzzzzz <Melzzzzz@zzzzz.com> - 2020-01-07 10:02 +0000
          Re: Wading through template instantiation errors for allocator Bo Persson <bo@bo-persson.se> - 2020-01-07 15:27 +0100
  Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 10:36 +0100
    Re: Wading through template instantiation errors for allocator Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-07 10:42 +0100

csiph-web