This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using stl containers in gcc
- From: Andres Tiraboschi <andres dot tiraboschi at tallertechnologies dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 3 May 2016 12:30:35 -0300
- Subject: Re: Using stl containers in gcc
- Authentication-results: sourceware.org; auth=none
- References: <CAJZwELk_0K4a_hEx1V=W0dOxKjDo7nfa4W0mdeO-Y2m7Pv1URQ at mail dot gmail dot com> <0a7b0410-73b6-b7f0-681f-bbca637f4a2d at redhat dot com> <20160503150226 dot GB26501 at tucnak dot zalov dot cz>
This raises a further question: why are gcc containers preferred over stl ones.
Thanks, AndrÃs.
2016-05-03 12:02 GMT-03:00 Jakub Jelinek <jakub@redhat.com>:
> On Tue, May 03, 2016 at 08:59:11AM -0600, Jeff Law wrote:
>> On 05/03/2016 08:44 AM, Andres Tiraboschi wrote:
>> >Hi,
>> >Does anyone know if there is a good reason for not using stl
>> >containers in gcc sources?
>> >I'm asking because I didn't find any use of them in the code I read.
>> The GCC coding conventions allow the use of the standard library; but you
>> have to be careful WRT objects that are subject to garbage collection.
>
> And, if there is a GCC counterpart of a particular container, the GCC
> counterpart should be used instead of the stl one.
> E.g. vec, or hash_map etc.
>
> Jakub