char配列、char、std::stringの任意の組み合わせを連結する関数を書きました。メモリ確保を一回だけします。 C++17の畳み込み式で、全体の文字列長を計算しています。 #include <string> #include <cstring> #include <utility> std::size_t string_length(const std::string& s) noexc</utility></cstring></string>…
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。