79741818

Date: 2025-08-21 04:29:25
Score: 0.5
Natty:
Report link

A workaround to the original code could be:

template<int...n> struct StrStuff {
    template<int...n0> explicit StrStuff(char const(&...s)[n0]) {}
};
template<int...n> StrStuff(char const(&...s)[n])->StrStuff<n...>;

int main() {
    StrStuff g("apple", "pie");
}

But I still wonder why the original code can/can't compile in different compilers.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Erciyuanshagou