I think it’s the author of [[safe c++]] who pointed out that if we have to maintain non-default big4, then it’s extra workload for the maintenance programmer. He argued convincingly that it’s not a good idea to require other programmers or yourself to “always remember to do something”
pointer as field –#1 pattern in c++ explains that shared_ptr as a pointer field allows us to use the default big4.
In many cases, people need to store addresses in a container. Let’s use std::vector for example. Both smart ptr and raw ptr are common and practical
- Problem with raw ptr — stray pointer. Usually we the vector doesn’t “own” the pointee, and won’t delete them. But what if the pointee is deleted somewhere and we access the stray pointer in this vector? smart pointer would solve this problem nicely.
- J4 raw ptr — footprint efficiency. Raw ptr object is smaller.
A collateral system professional told me some securities in his system have no cusip or isin, but must have one of them.
I believe some international assets pledged as collateral could be missing one of them.
Japanese gov bond is a common repo asset — cross-currency repo. The borrower needs USD but uses Japanese bond as collateral.
Singapore is a small country
- so I have a chance to make a small difference
- it’s more fragile, needs more care and feeding
1) make_shared can’t call a private ctor. If your ctor is private, you have to use
shared_ptr sp(new MyClass);
2) If your MyClass dtor is private, you simply can’t hold it in shared_ptr.
lower_bound() can return a value equivalent to the target; upper_bound is strictly higher than target
To achieve symmetry, we need to decrement (if legal) the iterator returned from upper_bound.
I used to understand these things very well.
I feel Current Yield is a simplistic yardstick, not popular with quants or “serious” investors. It’s simply the coupon rate divided by current valuation.
In java, this is simple and extremely common: Shape interface.
In c++, we need a container of shared_ptr to pure abstract base class.
- pure abstract interface can support MI
- shared_ptr supports reference counting, in place of garbage collection
- pointer instead of nonref payload type, to avoid slicing.
If you remove “friend” then the friend function would be compiled as a non-static method. See example in https://bintanvictor.wordpress.com/2017/08/28/list-all-free-slots-between-meetings-bbg/