last day (15 days later) » 

9:51 PM
0
A: Compare boost::system::error_category

seheYour comment: @sehe you code is only comparing the error code value and not the category, in your map. Most people are only using the value, but as has been mentioned, the value is not unique, it can occur in more than one category. It states this both in the boost documentation and has been ...

 
(fixed a silly copy/past error in my sample)
 
Look at operator == of boost::system::error_category and then ponder what happens when we statically linked boost to several libraries in our project, comparing the lhs from one to the rhs in another. Addresses are !=
 
Well. Derp. Did you just downvote this answer because you failed to make clear what you already asked elsewhere? Here, again, you just say "Look at operator== of boost::system::error_category". Well. Blimey! That should have been in your question then! Even I was able to at least include the point of the code I referred to in my answer. Damn. It's fine if you want to rant, but don't expect too much help when you do. :grumble:
 
I downvoted it because I tried it and it doesn't work. An answer that doesn't work is not a good answer. I explained why it doesn't work. You yourself can see why it doesn't work, so why would you expect it to be helpful?
 
Right. That doesn't make the question less bad. Also it doesn't acknowledge the fact that people are trying to help, regardless of that. Thank you very much. I was still trying to figure out what exactly you are facing. Because "using the address is silly" - that's probably not a very smart assessment. Using the address has been a very conscious design decision (which, incidentally has been standardized for the C++ standard library too AFAICT). So, the only interesting question remaining is: can this work in statically linked Boost System. If so, how.
Re.: I, myself, CANNOT see that it doesn't work. I link a bloddy WORKING example. You yourself can SEE that is does work. FFS. I value direct observation over hear-say. Especially hear-say that leaves out all the critical information that is required for reproducing.
Finally, upvotes say "helpful". No upvote says: "not helpful". Downvotes say: "bad, poor, wrong".
 
9:51 PM
You are awefully upset about one downvote. Life will balance out I assure you. I would also downvote catch(...){}, because while it appears to work on your box, it is the incorrect answer. You, also seem to be blaming the question. the question was and still is, how do we compare boost::system::error_category correctly? New information was brought to light and added to the question after the fact, via an edit, for the benefit of anyone reading, but the question remains the same and is still outstanding.
 
10:40 PM
@ChristopherPisz I'm not at all worried about the downvote. I'm just annoyed by your dismissive attitude (not just to me) when at best the question is misleading and underspecified on a number of key points.
How do you compare it correctly? - use operator==
Comparing different instances of global categories seems to be a usage error (it's your job to ensure there's only one instance), not an implementation flaw. Whether or not this caveat ought to be documented with Boost System w.r.t. static linking, mmm. You could ask the devs about that.
Your repeated claim that "it is only comparing the error code value and not the category" is patently untrue.
Again, if you can give selfcontained example that demonstrates the problem, I'm all for it. Here's my counter example. coliru.stacked-crooked.com/a/8bf53c43be255cc7 (clone it from this gist: gist.github.com/587707da5bee957eb806789a248b1e76.git)
Life will balance out, sure. That doesn't mean I can't give you feedback on how you treat people.
Splendid if you would downvote things that should be downvoted, but I didn't post catch(...){}. I post working code, with proof of it working, not even "on my machine". You just dismiss it because it happens to not-work "on your my machine" - that's quite ironic.
Now if you want to get constructive, post a similar SSCCE that demonstrates the problem. It's OK if that's only on your compiler/platform/etc. That's just information that will make your question complete. So that people CAN help.
Don't dismiss things because you don't you are frustrated. We're not stupid. Neither are you. So, work together.
 

last day (15 days later) »