[
https://issues.apache.org/jira/browse/MESOS-6560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benjamin Bannier reassigned MESOS-6560:
---------------------------------------
Assignee: Benjamin Bannier
> The default stout stringify always copies its argument
> ------------------------------------------------------
>
> Key: MESOS-6560
> URL: https://issues.apache.org/jira/browse/MESOS-6560
> Project: Mesos
> Issue Type: Bug
> Components: stout
> Reporter: Benjamin Bannier
> Assignee: Benjamin Bannier
> Labels: coverity, tech-debt
>
> The default implementation of the template {{stringify}} in stout always
> copies its argument,
> {code}
> template <typename T> std::string stringify(T t)
> {code}
> For most types implementing a dedicated {{stringify}} we restrict {{T}} to
> some {{const}} ref with the exception of the specialization for {{bool}},
> {code}
> template <> std::string stringify(const bool& b)
> {code}
> Copying by default is bad since it requires {{T}} to be copyable without
> {{stringify}} actually requiring this. It also likely leads to bad
> performance.
> It appears switching to e.g.,
> {code}
> template <typename T> std::string stringify(const T& t)
> {code}
> and adjusting the {{bool}} specialization would be a general improvement.
> This issue was first detected by Coverity in CID 727974 way back on
> 2012-09-21.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)