I got the following ugly code:
template < class _Coeff,
unsigned _nVars,
typename _Expo=int,
template <class, class> class _Map = _Map >
class Polynomial
: boost::ring_operators< Polynomial<_Coeff,_nVars,_Expo,_Map>
, boost::addable < Polynomial<_Coeff,_nVars,_Expo,_Map>, _Coeff
, boost::addable < Polynomial<_Coeff,_nVars,_Expo,_Map>,
std::pair< std::array<_Expo,_nVars>, _Coeff >
, boost::subtractable < Polynomial<_Coeff,_nVars,_Expo,_Map>, _Coeff
, boost::subtractable < Polynomial<_Coeff,_nVars,_Expo,_Map>,
std::pair< std::array<_Expo,_nVars>, _Coeff >
, boost::multipliable < Polynomial<_Coeff,_nVars,_Expo,_Map>, _Coeff
, boost::multipliable < Polynomial<_Coeff,_nVars,_Expo,_Map>,
std::pair< std::array<_Expo,_nVars>,_Coeff >
> > > > > > > {
In particular, I hate to repeat Polynomial<_Coeff,_nVars,_Expo,_Map>
. Is there a way to improve this syntax without using the preprocessor ? I can't manage to get any help from the using
keyword here.
Just for the infos: I'm writing multivariate polynomials where _Coeff
is the class of the coefficients and the terms X1^4x2^4
are represented as std::array<_Expo,_nVars>
.