I\'m trying to define some variadic template like that:
typedef const char CCTYPE[];
template struct StringConcat { ... };
You can solve the problem of making your std::cout << StringConcat work.
template struct StrBag {};
template void StringConcat(StrBag) {}
std::ostream &print(std::ostream &os) {
return os;
}
template
std::ostream &print(std::ostream &os, CCTYPE t1, T ...t) {
os << t1;
return print(os, t...);
}
template
std::ostream &operator<<(std::ostream &os, void(StrBag)) {
return print(os, Str...) << std::endl;
}
Now you can say
char foo[] = "foo"; char bar[] = "bar";
int main() {
std::cout << StringConcat << std::endl;
}
Hope it helps.