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


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

Re: On stateful allocators and GCC

Newsgroups comp.lang.c++
From Melzzzzz <Melzzzzz@zzzzz.com>
Subject Re: On stateful allocators and GCC
References <05d0355f-1bce-49a1-b8c5-decc89cfe8e5@googlegroups.com>
Message-ID <PdFdF.255997$TY7.82732@fx29.am4> (permalink)
Organization usenet-news.net
Date 2019-09-10 04:00 +0000

Show all headers | View raw


On 2019-09-10, Daniel <danielaparker@gmail.com> wrote:
> Has anyone attempted to use stateful allocators with GCC basic_string?
>
> My attempts with versions up to 9 result in a compile time error
>
> /usr/include/c++/9/bits/basic_string.tcc:596:30: error: no matching function for call to ‘my_alloc::my_alloc()’
>   596 |       if (__n == 0 && __a == _Alloc())
>
> My example allocator my_alloc doesn't have a default constructor, which I don't think you would ever want on a stateful allocator. So why would GCC
> want to compare the passed allocator __a with the default constructed
> allocator _Alloc()?

Don't know about allocator requirements, but if default constructor is
not one of them it is a bug in gcc...
>
> I have no issues with vs or clang.
>
> Thanks,
> Daniel
>
>
>


-- 
press any key to continue or any other to quit...
U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec
Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi 
bili naoruzani. -- Mladen Gogala

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


Thread

On stateful allocators and GCC Daniel <danielaparker@gmail.com> - 2019-09-09 20:54 -0700
  Re: On stateful allocators and GCC Melzzzzz <Melzzzzz@zzzzz.com> - 2019-09-10 04:00 +0000
    Re: On stateful allocators and GCC James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-09-10 08:56 -0400
  Re: On stateful allocators and GCC Öö Tiib <ootiib@hot.ee> - 2019-09-10 00:25 -0700
    Re: On stateful allocators and GCC Öö Tiib <ootiib@hot.ee> - 2019-09-10 01:04 -0700
      Re: On stateful allocators and GCC Daniel <danielaparker@gmail.com> - 2019-09-10 04:51 -0700
    Re: On stateful allocators and GCC Daniel <danielaparker@gmail.com> - 2019-09-11 04:39 -0700
  Re: On stateful allocators and GCC Juha Nieminen <nospam@thanks.invalid> - 2019-09-11 09:04 +0000
    Re: On stateful allocators and GCC Daniel <danielaparker@gmail.com> - 2019-09-11 04:32 -0700
      Re: On stateful allocators and GCC Manfred <noname@add.invalid> - 2019-09-11 15:02 +0200
        Re: On stateful allocators and GCC Daniel <danielaparker@gmail.com> - 2019-09-11 06:33 -0700

csiph-web