M
ManicQin
I have two templated classes
for example let's say:
template <typename _T , class _Trait>
class modifier
{
public:
_T modify()
{
return _Trait::change(m_data);
}
_T m_data;
};
template <typename _T>
class TraitSample
{
static _T change(_T value) { return value + 1; }
};
when I instantiate a modifier class I need to supply the type of the
typename
in the modifier and in the trait class:
modifier<int ,TraitSample<int> > sample;
is there a way to "bind" the two parameters?
(and in the case of more parameters a way to pair them all)
Thanks.
for example let's say:
template <typename _T , class _Trait>
class modifier
{
public:
_T modify()
{
return _Trait::change(m_data);
}
_T m_data;
};
template <typename _T>
class TraitSample
{
static _T change(_T value) { return value + 1; }
};
when I instantiate a modifier class I need to supply the type of the
typename
in the modifier and in the trait class:
modifier<int ,TraitSample<int> > sample;
is there a way to "bind" the two parameters?
(and in the case of more parameters a way to pair them all)
Thanks.