I have some container-using code that is causing me grief. The issue is that I want to put a smart pointer (unique_ptr) in one of the subfields. Eg:
struct subrecord {
int id;
int handle;
std::list<std::unique_ptr<some_really_big_record>> update; // <-- Problem field
};
struct database {
std::map <std::string, subrecord> name_subrec_map;
std::vector <std::string> a_names;
std::vector <std::string> b_names;
};
Everything compiled just fine until I tried adding that update
field. Once I did that, the compiler started to complain that there's no usable copy operator for that unique_ptr. That's fair enough, it isn't supposed to have one. I wasn't intending these map entries to be copied anyway.
However, the compiler is not telling me where in my code this copy is coming from. There's rather a lot of it by now. Is there any good way to tell? I've tried searching for references to update
and name_subrec_map
and commenting them out, but haven't had any luck at all. The only thing that gets rid of the error is commenting out that update
field itself.
I'd hate to have to switch to a shared_ptr, just because I can't find the dang copy.