I have a function which works with GdkPixbufs (simplified):
void test_function(std::vector<GdkPixbuf> &images)
{
std::vector<std::filesystem::path> filenames = {"path/a", "path/b"};
for(int i = 0; i < 2; i++)
{
images[i] = *gdk_pixbuf_new_from_file(filenames[i].string().c_str(), NULL);
}
return;
}
GCC throws expression must be a modifiable value
error at the images
assignment line. Everything seems fine to me. Why does it happen?