10
Korzystanie GCC 6.1, następujący program:Co robi GCC dla mojej zmiennej statycznej w lambda?
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
#include <iostream>
int main()
{
static const std::string foo {"foo"};
std::vector<std::string> bars {{""}};
std::cout << "foo outside: " << foo << std::endl;
std::for_each(std::cbegin(bars), std::cend(bars), [] (const auto& bar) {
std::cout << "foo inside: " << foo << std::endl;
});
}
Drukuje:
foo outside: foo
foo inside:
Co się dzieje?
mam żadnych problemów z gcc 6.2.1 i kodzie. – gj13
Zespół deweloperów gcc, cały twój bugware należy do nas –
gcc 6.1.1 również nie ma problemu – ks1322