
On Jul 16, 3:09 am, Alfredo Correa
namespace boost{ namespacephoenix{ #define RESULT_OF_QUANTITY_UNITS_GEN( PhoenixopnamE, UnitsopnamE ) \ template
\ struct result_of_##PhoenixopnamE < \ boost::units::quantity &, \ boost::units::unit \>{ \ typedef \ typename boost::units::UnitsopnamE##_typeof_helper< \ boost::units::quantity
, boost::units::unit \ >::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
{ \ typedef \ typename boost::units::UnitsopnamE##_typeof_helper< \ X, \ boost::units::unit
\ >::type type; \ }; RESULT_OF_QUANTITY_UNITS_GEN(multiplies, multiply) RESULT_OF_QUANTITY_UNITS_GEN(divides , divide ) #undef RESULT_OF_QUANTITY_UNITS_GEN