代わりに参照渡しをしましょう。 void some_function(vector<int> v) { // Never do it unless you’re sure what you do! // ... } Instead, use the following construction: void some_function(const vector<int>& v) { // OK // ... }
![STLでvectorを直接引数で渡すのは重すぎるのでやめてくれ - peroon's diary](https://cdn-ak-scissors.b.st-hatena.com/image/square/735bfc9ddd0a4d05497374824511a14ad0f9d5b9/height=288;version=1;width=512/http%3A%2F%2Fhbb.afl.rakuten.co.jp%2Fhgb%2F%3Fpc%3Dhttp%253A%252F%252Fthumbnail.image.rakuten.co.jp%252F%25400_mall%252Fbook%252Fcabinet%252F8947%252F89471451.jpg%253F_ex%253D128x128%26m%3Dhttp%253A%252F%252Fthumbnail.image.rakuten.co.jp%252F%25400_mall%252Fbook%252Fcabinet%252F8947%252F89471451.jpg%253F_ex%253D80x80)
代わりに参照渡しをしましょう。 void some_function(vector<int> v) { // Never do it unless you’re sure what you do! // ... } Instead, use the following construction: void some_function(const vector<int>& v) { // OK // ... }
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く