Код: Выделить всё
#include
#include
void test(const std::vector& a, std::vector& b) {
b[0] = 45;
}
int main() {
std::vector v(1,0);
test(v, v);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/24999639/pass-same-object-as-const-and-non-const-reference[/url]
Мобильная версия