• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

“Safe C++ Subset” Is Vapourware

Ok, I'll bite

There is a kind of developer who likes to take the WRONG DESIGN and then program it in C++ and then tell us what's wrong. I see this on a regular basis. Shows a lack of analytic thinking.

You have fallen into his trap.
C++:
unique_ptr<int> p;
void foo(const int& v) {
  p = nullptr;
  cout << v;
}
void bar() {
  p = make_unique(7);
  foo(*p);
}

In the current case, std::unique_ptr() is the wrong tool. It was not built for that purpose.
Use shared_ptr.
Recommended usage of std::unique_ptr
So, to use std::unique_ptr() define it in a scope!!! and stop the messing by trying to conjure up crap examples.
 
Last edited:
If schools start graduating people with rust experience, the writing is on the wall for C++. Shifting school curriculum takes a big reason. Maybe a hit indie game, maybe some other killer app. I don't think servo is the one.

Now we know why.

Yawn
 
Last edited:
Back
Top