BIND 10 #2292: eliminate const_cast from domaintree.h
BIND 10 Development
do-not-reply at isc.org
Wed Oct 3 00:53:21 UTC 2012
#2292: eliminate const_cast from domaintree.h
-------------------------------------+-------------------------------------
Reporter: | Owner: UnAssigned
jinmei | Status: reviewing
Type: | Milestone:
defect | Sprint-20121009
Priority: | Resolution:
medium | Sensitive: 0
Component: data | Sub-Project: DNS
source | Estimated Difficulty: 4
Keywords: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Comment (by jinmei):
I've not given a full review to yet, but it looks like somewhat
different from what I originally expected, so let me begin with
a higher level question.
For example, I thought we should be able to make `node`
`const ZoneTableNode*` in `ZoneTable::findZone()` because this node
should only be used in read-only context. To do this we'll have to
change the definition of `ZoneTable::FindResult` so the type of
`zone_data` will be `const ZoneData*`. This will probably require
some adjustments to other interfaces...and, repeating this type of
propagation of constness, I expected we should eventually be able to
eliminate the non cost version of `DomainTree::find()` like this:
{{{#!cpp
Result find(const isc::dns::Name& name,
DomainTreeNode<T>** node) const {
DomainTreeNodeChain<T> node_path;
const isc::dns::LabelSequence ls(name);
return (find<void*>(ls, node, node_path, NULL, NULL));
}
}}}
And, as a result of that, I thought we should be able to kill the
const_cast naturally.
Wouldn't it be possible?
--
Ticket URL: <http://bind10.isc.org/ticket/2292#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list