This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [cxx-conversion] New Hash Table (issue6244048)


On 5/25/12, Michael Matz <matz@suse.de> wrote:
> On Fri, 25 May 2012, Jakub Jelinek wrote:
> > > +  /* Return the current size of this hash table.  */
> > > +
> > > +  size_t size()
> > > +  {
> > > +    return htab->size;
> > > +  }
> >
> > (and various other places) - formatting is wrong, missing space
> > between (.

Yes, an omission that's a consequence of dealing with several
coding conventions.

> And it doesn't start at the first column, and type isn't on a
> separate line.  I realize that this is a member method, hence
> indenting and C GNU coding standards conflict, but the latter do
> have some nice properties (for instance that 'grep ^func_name *.c'
> finds only the definition, not all the calls to func_name).

We can address this issue by requiring all function definitions
to appear outside the class definition.  The code is more verbose,
but livable.

> I think we need a discussion about style, now that actually people
> are working on this.

Yes.

> > > +void
> > > +typed_htab <Element, Hash, Equal, Remove, Allocator>
> > > +::dispose ()
> >
> > Do we want to format methods this way?
>
> Don't know, but at least it starts at the first column, and
> grepping for ^:: will give only C++ methods, 'grep -B1 ^::' even
> including class.  So it's no too horrible, despite the syntactic
> C++ noise.

For template classes, the specification of an out-of-line member
function is going to be long, so a single-line specification is
likely to overflow often.  Whatever we chose, it should be reasonably
extended to multiple lines.

-- 
Lawrence Crowl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]