actually, specialization and not overload should be correct. But idea remains the same.
Just a question on your discussion. Why not to let mpl::if choose an appropriate overload, like:
//... somewher in c
private:
inline void functionality_impl()const/or non const
{
//make impl here
}
inline void f()
{
f<typename mpl::if_c<SYNCH, ScopedCriticalSection, void*>::type>();
}
template<class T>
void f();
void f<ScopedCriticalSection>()
{
scs(cs);
functionality_impl();
}
void f<void*>()
{
functionlity_impl();
}
Greetings,
Ovanes