Funny bug with vector of function

Правка en2, от Sacha, 2025-07-15 00:37:07

Will vector<int> be copied when f[0] is called?

#include <bits/stdc++.h>
using namespace std;
signed main() {
    vector<function<void(const vector<int>)>> f = {
            [&] (const vector<int>& v) -> void {

            }
    };
}
Spoiler

Why would anyone use vector<function> in CP?

This task with prefix sums for 8 types of triangles xD

TL

1-char fix (line 135)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Sacha 2026-04-27 01:36:37 59 Tiny change: 'iangles xD\n\n[TL](h' -> 'iangles xD. Here are my submissions:\n\n[TL](h'
en2 Английский Sacha 2025-07-15 00:37:07 256 Tiny change: '1-char fix](https://' -> '1-char fix (line 135)](https://'
en1 Английский Sacha 2025-07-15 00:15:25 445 Initial revision (published)