#253: convert::from_to is not flexible for the user ---------------------+------------------------------------------------------ Reporter: lazzara | Owner: lazzara Type: defect | Status: new Priority: major | Milestone: Component: Milena | Version: 2.0 Keywords: | ---------------------+------------------------------------------------------ convert::from_to allows the user to convert values to another value type.
Current mechanism does not allow the user to provide its own conversion functions.
To add a new conversion function, an overload of from_to_() must be declared in the namespace mln::convert::over_load. A forward declaration must be added to from_to.hxx in order to make it taken into account by g++ while resolving the overloaded functions. This way, we ensure the fact that g++ is aware of this definition at the very beginning.
This method is intrusive and definitely error prone since the forward declarations may not be maintained correctly.
#253: convert::from_to is not flexible for the user ---------------------+------------------------------------------------------ Reporter: lazzara | Owner: lazzara Type: defect | Status: assigned Priority: major | Milestone: Component: Milena | Version: 2.0 Keywords: | ---------------------+------------------------------------------------------ Changes (by lazzara):
* status: new => assigned
Comment:
Edwin noticed that g++ looks up to overloads in two passes. 1/ Try to find the closest overload among the previously declared functions. 2/ Try to find the closest overload among all the declared functions in the namespaces of the first argument (http://en.wikipedia.org/wiki /Argument-dependent_name_lookup).
By using this second mode, we could avoid all the forward declarations in from_to.hxx and make the conversion system extendable just by defining the from_to_() overloads in the same namespace as their first argument.
#253: convert::from_to is not flexible for the user ----------------------+----------------------------------------------------- Reporter: lazzara | Owner: lazzara Type: defect | Status: closed Priority: major | Milestone: Olena 2.1 Component: Milena | Version: 2.0 Resolution: fixed | Keywords: ----------------------+----------------------------------------------------- Changes (by lazzara):
* status: assigned => closed * resolution: => fixed * milestone: => Olena 2.1
Comment:
This issue is fixed in branch unstable/scribo in patch e1b3bd773168c12df5dba50ec1f51800099f680e.
We now rely on Argument-Dependent Lookup (ADL) mechanism which do not need any forward declaration before use to select the right overload.