[squid-dev] [RFC] Refactor HttpHeader

Kinkie gkinkie at gmail.com
Thu Jul 30 19:44:26 UTC 2015


On Thu, Jul 30, 2015 at 6:42 PM, Alex Rousskov <
rousskov at measurement-factory.com> wrote:

> On 07/30/2015 01:44 AM, Kinkie wrote:
>
> > headerDescription: a std::vector keyed by header ID containing header
> type
>
> HeaderDescriptions (plural) then.
>

Ok, will change.


> > template <typename EnumType>
> > typedef struct LookupTableRecord
> > {
> >    const char *name;
> >    EnumType id;
> > }
>
> Please avoid "struct" whenever possible. Typing "public:" once is better
> that always remembering whether to search for and forward-declare a
> "struct Foo" or a "class Foo".
>

Sure.


> > template<typename Enumtype, typename RecordType =
> > LookupTableRecord<EnumType> >
> > class LookupTable
> > {
> >    //...
> > }
> >
> > This would make it so that someone could define a custom Record type,
> > and as long as that record type matches the signature of
> > LookupTableRecord, LookupTable won't care.
>
> Do not add that template parameter until you actually need to customize
> the record type. If you end up using this design, just typedef Record to
> be LookupTableRecord.
>

Need is already present; it's done exactly as you say.
Thanks!

-- 
    Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150730/0ddf7fff/attachment.html>


More information about the squid-dev mailing list