Closed betsch85 closed 1 year ago
It is really hard to debug something when you are only giving us code snippets and error messages that don't fit to those snippets with line numbers that we can't see where they are coming from. The code refers to MyManager
and YourManager
. In the error message it is FMRelationsManager
.
Your code says true, true, false
, which means you are not interested in relations (the last false
). But you are still asking for relation members (this->get_member_relation(member.ref());
) which doesn't make much sense. Other than that I can't see anything wrong with the code immediately (except that std::cout << ...
is not noexcept
so those functions shouldn't be, but that's not the source of the error you are getting here). There might well be something wrong with the example code, you already found the problem with the missing variable.
Can you give us the complete code that you are using?
It is really hard to debug something when you are only giving us code snippets and error messages that don't fit to those snippets with line numbers that we can't see where they are coming from. The code refers to
MyManager
andYourManager
. In the error message it isFMRelationsManager
.
fixed
Your code says
true, true, false
, which means you are not interested in relations (the lastfalse
). But you are still asking for relation members (this->get_member_relation(member.ref());
) which doesn't make much sense. Other than that I can't see anything wrong with the code immediately (except thatstd::cout << ...
is notnoexcept
so those functions shouldn't be, but that's not the source of the error you are getting here). There might well be something wrong with the example code, you already found the problem with the missing variable.Can you give us the complete code that you are using?
I don't have access to the full source right now but you should be able to use the two code snippets from the manual and should get the same error. The compiler error is in a libosmium
header, not in my own code
I also tried it with true, true, true
, but even if the last one is false
, the function just shouldn't be called, there shouldn't be a compilation error
If I comment out this line osmium::relations::read_relations(input_file, manager);
the code compiles, so it seems like passing manager
to read_relations()
calls the copy constructor of RelationMember
which ist marked as = deleted
I think I just found my error, I removed the parameter comments of bool new_member(const osm::Relation, const osm::RelationMember, std::size_t) noexcept
and it seems I accidentially removed the &
, which would result in passing a copy without a copy constructor, my bad
I'll close this issue later today when I verified my assumption
yup, that was it
thanks and sorry :)
What version of libosmium are you using?
2.20.0
What operating system and compiler are you using?
MSVC 2022, tried with /std=c++14, /std=c++17 and /std=c++20
What did you do exactly?
trying to compile code from the manual (https://osmcode.org/libosmium/manual.html#working-with-relations)
if it is wrong to use
MyManager
as the class name and the first template param please let me know because its (kind of) unclear from the manual what to use here (usesYourManager
andYourClass
)hint: it compiles if I remove the instantiation from the class in main
What did you expect to happen?
code compiles without errors
What did happen instead?