G
George Sakkis
Hi all,
I have the following two template function definitions:
template <typename Container, typename Sepatator>
string join(const Container& c, const Sepatator& s) {
// ...
}
template <typename Container>
string join(const Container& c) {
return join(c, ' ');
}
I tried to merge them into one using a default argument for Separator, but the compiler (gcc 3.3.1)
complains that default template arguments may not be used in function templates. What's the reason
for this limitation and, more importantly, is there a workaround for it ?
TIA,
George
I have the following two template function definitions:
template <typename Container, typename Sepatator>
string join(const Container& c, const Sepatator& s) {
// ...
}
template <typename Container>
string join(const Container& c) {
return join(c, ' ');
}
I tried to merge them into one using a default argument for Separator, but the compiler (gcc 3.3.1)
complains that default template arguments may not be used in function templates. What's the reason
for this limitation and, more importantly, is there a workaround for it ?
TIA,
George