c++big4: prefer synthesized(empty)implementations

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.

Advertisements

container of smart^raw pointer

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.

some international securities have no cusip/isin but never missing both

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.