BIND 10 #2292: eliminate const_cast from domaintree.h

BIND 10 Development do-not-reply at isc.org
Wed Oct 3 07:54:21 UTC 2012


#2292: eliminate const_cast from domaintree.h
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  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      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jinmei


Comment:

 Hello

 It doesn't seem to be possible. Sometimes, we need the nodes to be
 mutable:
  * The `ZoneTable::setZoneData` is quite natural place for a mutable node.
  * Even the mutability of the `zone_data` in the `FindResult` is used
 sometimes, for example here:
 {{{#!c++
 if (fr.zone_data != NULL) {
     ZoneData::destroy(mem_sgmt_, fr.zone_data, rrclass_);
 }
 }}}

 So if we found a way to get rid of the mutability, I think it would feel
 very
 unnatural and counter-intuitive.

 What I'm thinking of is making the find variants that return mutable
 version as
 non-const (so you couldn't call them on const domain tree). I think this
 would
 need some changes in the tests (I tried something like that as an
 experiment
 and it complained), but it should be possible and more or less logical.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2292#comment:6>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list