3 ms·
I'm new to C++, what are lines 11-12 for? I see that it doesn't compile without it. It doesn't seem to be the new 'arrow return type' syntax because there's no
by jkcxn 6y ago
I'm new to C++, what are lines 11-12 for? I see that it doesn't compile without it. It doesn't seem to be the new 'arrow return type' syntax because there's no auto keyword.
Edit: I found it - it's a 'template deduction guide' https://stackoverflow.com/questions/40951697/what-are-template-deduction-guides-and-when-should-we-use-them https://stackoverflow.com/questions/40951697/what-are-templa...
- gpderetta 6y agoYes, the functionality was added in C++17, it is quite convenient, before you had to write boilerplate make_X 'constructor' functions. In C++20 this specific deduction guide is no longer required as it is implicitly generated for template aggregates, so even less boilerplate.