exercism / exercism/cpp

New Exercise Idea: Template parameter packs

オープン
#501 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
290
フォーク
244
PR マージ指標
30日以内にマージされた PR はありません

説明

With the new v3 concepts I though it would be good to focus more on C++ specific ideas which aren't currently covered in the exercises. Here's some example solution code for the exercise:

```
#include
#include

// Should be able to take in any length/ type of arguements
template std::string concat(Args... args)
{
std::stringstream output;
((output << std::forward(args) << ","), ...);
return output.str();
}

int main() {
std::cout << concat(123, "test") << std::endl;
// Prints: "123, test,"
return 0;
}
```

Wanted to run this by other people before I went and created a whole exercise around it.

Also FYI the "Please see the contributing guide" in the README is a broken link.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。