Github user SolidWallOfCode commented on the issue:

    https://github.com/apache/trafficserver/pull/1477
  
    Two comments.
    
    First,I think the function approach is not a good one. I would recommend 
straight struct templates with a value. Something like
    ```
    template <typename T> struct OverridableType { static const 
OverridableDataType value = OVERRIDABLE_TYPE_NULL; };
    template <> struct OverridableType<MgmtFloat> { static const 
OverrideableDataType value = OVERRIDABLE_TYPE_FLOAT; };
    
    ...
    // in InkAPI.cc
    typ = 
OverridableTypeFor<decltype(overridable_config->safe_requests_retryable)>::value;
    ```
    
    Alternatively, and IMHO even better, is just use `std::type_info` and get 
rid of `OverridableDataType` entirely. Then something like `ConfigSetFloat` 
checks if the returned type info is `typeid(MgmtFloat)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to