The rate dramatically changes with demographic, for example many of those were married young and did not complete education.
> who you pick to marry
The quote doesn't say whether :) Married men also tend to make more money and work for longer periods of time. There is a cynical view of whether that's good or not, but 40-50 year old single men don't seem to be a particularly successful demographic.
Married men live longer, but the last years are mostly garbage anyway. If you’re co-dependent or really need that companionship, autonomy and agency might not be what you’re optimizing for. Cashflow and wealth doesn’t buy love or happiness, only choices and freedom. Optimize accordingly.
My apologies, sometimes I forget connecting the dots must be more explicit. Tell me the lifestyle of someone who has their assets split in half and having to provide alimony/maintenance for (possibly) the rest of their partner’s life. I can only speak for my circle of social acquaintances, many divorced, all living terrible lifestyles because of the financial burden of divorce. Some got away with only losing half their assets and having to provide $3k-$5k/month post tax to their ex partners. Some, worse. One expects to have to work to death, and can never retire.
I’m just working back to first principals. You can be happy without the legal Russian Roulette of marriage is my overarching thesis, and I apologize again it took so many words to arrive at my point.
Now you're talking about financial burden again. I don't wish the situation you are describing on anyone, and I am sympathetic to making choices to avoid that happening. I don't think that is inconsistent with my other comments.
Just to add, here are a few other things that also limit your day to day freedom and add some risk of legal nightmares:
- operating a business
- owning a home or other building
- running for political office
- raising a child
- using a professional license (medical, law, civil engineer, etc)
>The rate dramatically changes with demographic, for example many of those were married young and did not complete education.
So OP, a 28 year old male still in the process of completing education?
I agree with ianai and toomuchtodo, marriage can wait (assuming one is even interested in it) until you've made your place in the world and have time and room to think about such things.
Conversely when i was in a similar situation, my marriage was the thing that helped carry me through. She was a rock and gave me the kind of support i wasnt really getting anywhere else. But we also shared the journey (hers and mine) and that experience in itself is more valuable than my degree (which i neither use nor rarely reference).
IMHO the reality is a marriage os neither something required nor something to avoid, it lies along side professional life and again IMHO, recommending one to get married or not doesnt deserve a place alongside how one should pursue their career goals. They should be equally pursued in a balanced fashion suited to the individual.
This is quite unfortunate. The way to get a really good hash table is by enforcing a bunch of simplifying assumptions (power of 2 sizes, sentinel values, etc). But the C++ committee has to make the "one true table" for everyone.
std::map actually seems to fit this role better. It works reasonable well for many workloads and types without tuning a bunch of parameters.
All of <algorithm> uses ordering operators as well. If you have a "regular" type with proper comparison and assignment operators, it works for everything, container keys, sorting, etc, etc.
> so hash map will generally be faster in this regard.
Complexity is not a measure of runtime. The performance drawbacks for std::map have to do with cache, not O(log) vs O(1). log(billion) is 30. And that's exactly how many comparisons you have to do, not a constant multiple of that.
With an open addressing hash table, who knows how many steps you will need to find an element. It's even more questionable if it does linked list chaining.
> binary search tree.
It's usually a red black tree and maybe could be a b-tree? "Search tree" is accurate.
You are correct. Sorry if I am being pedantic. I was also trying to suggest it could be a b-tree but others have pointed out that it doesn't quite fit the spec.
Doesn't std::unique only generally work on consecutive items, and effectively requires the items to already be in a container (or at the very least have access to iterators to the items)?
If so, that sounds fairly limiting to me (i.e. potential extra storage - of duplicates, sorting required, etc).
XOR is a bad way to do it, but there are ones that work much better that are described in answers to that post, and it's what other languages use in similar situations (e.g. tuples in Python and C#):
Yes, and eventually you start computing another hash of the buffer of the concatenated members. I'm not saying it can't be done, I'm just comparing it with recursive memberwise comparison.
> developer time is a significantly more expensive resource than compute
This also presupposes that making a fast program is a lot more work. However poor performance is usually due to negligence rather than a lack of optimization effort. All you need to write reasonably fast code by default (without micro-optimizing) is:
1. a good knowledge of available algorithms
2. a good understanding of the problem
1. Is a one-time investment on the programmers part that benefits all future programs they write. There is no marginal cost to being familiar with what's available in <algorithm>. 2. Has a marginal cost, but it's probably a time saver anyway. Measure once, cut twice.
The rate dramatically changes with demographic, for example many of those were married young and did not complete education.
> who you pick to marry
The quote doesn't say whether :) Married men also tend to make more money and work for longer periods of time. There is a cynical view of whether that's good or not, but 40-50 year old single men don't seem to be a particularly successful demographic.