On Jul 16, 3:09 am, Alfredo Correa <alfredo.cor...@gmail.com> wrote:
namespace boost{ namespacephoenix{ #define RESULT_OF_QUANTITY_UNITS_GEN( PhoenixopnamE, UnitsopnamE ) \ template<class XUnit, typename TX, class Dim, class System> \ struct result_of_##PhoenixopnamE < \ boost::units::quantity<XUnit,TX> &, \ boost::units::unit<Dim, System> \>{ \
typedef \ typename boost::units::UnitsopnamE##_typeof_helper< \ boost::units::quantity<XUnit,TX>, boost::units::unit<Dim, System> \ >::type type; \};
RESULT_OF_QUANTITY_UNITS_GEN(multiplies, multiply) RESULT_OF_QUANTITY_UNITS_GEN(divides , divide ) #undef RESULT_OF_QUANTITY_UNITS_GEN
this is a bit more generic: #define RESULT_OF_QUANTITY_UNITS_GEN( PhoenixopnamE, UnitsopnamE ) \ template< \ typename X, \ class Dim, class System> \ struct result_of_##PhoenixopnamE < \ X&, \ boost::units::unit<Dim, System> \
{ \ typedef \ typename boost::units::UnitsopnamE##_typeof_helper< \ X, \ boost::units::unit<Dim, System> \ >::type type; \ }; RESULT_OF_QUANTITY_UNITS_GEN(multiplies, multiply) RESULT_OF_QUANTITY_UNITS_GEN(divides , divide ) #undef RESULT_OF_QUANTITY_UNITS_GEN