[Boost-bugs] [Boost C++ Libraries] #12700: Returned type mess with find_flow_cost

Subject: [Boost-bugs] [Boost C++ Libraries] #12700: Returned type mess with find_flow_cost
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-19 16:41:56


#12700: Returned type mess with find_flow_cost
--------------------------------------------+----------------------
 Reporter: Dmitrii Marin <dmitry.marin@…> | Owner: jewillco
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
  Version: Boost 1.62.0 | Severity: Problem
 Keywords: |
--------------------------------------------+----------------------
 There are several overloads for find_flow_cost in find_flow_cost.hpp.
 However they differ by the return type. For example find_flow_cost(const
 Graph &g) returns edge capacity type while others return weight type. As a
 result the true flow cost can be lost due to type conversions, e.g.
 casting double (weight type) to int (capacity type).

 It should be determined which type to return (weight or capacity type). I
 think there should be a process determining which type is the best.
 Something like decltype(weight_t(0)*capacity_t(0))

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12700>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC