[bind10-dev] CharString, typedef or class?

Michal 'vorner' Vaner michal.vaner at nic.cz
Mon Jan 21 10:25:06 UTC 2013


Hello

On Fri, Jan 18, 2013 at 02:33:46PM +0100, Jelte Jansen wrote:
> Apart from making it public (see http://bind10.isc.org/ticket/2638), I
> want to consider making it a real class instead of a typedef (of
> vector<uint8_t>) with static helper functions.

I'd like to make it a class. If I look into the file, there are bunch of
functions to take care of the type (conversion to and from string, comparison,
etc.). It'd be cleaner to make them methods.

> Also, depending on whether we prefer a small extra cycle effort or 1
> byte per instance, we could get rid of the double size data (currently
> both in first byte and as vector size)

I'd be for not having it twice. Not because of the size, but because keeping the
same information twice is wrong and prone to inconsistency bugs.

With regards

-- 
There is one difference between linux and windows.
With windows, you pay for the software, but you get all the T-shirts for free.
With linux, you get all the software for free, but you buy the T-shirts.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20130121/157fd1fb/attachment.bin>


More information about the bind10-dev mailing list