Eve-ning / vsrg

a c++ static library for vsrg
https://twitter.com/dev_evening
2 stars 0 forks source link

Utilize move semantic/NRVO instead of std::shared_ptr #24

Open longnguyen2004 opened 4 years ago

longnguyen2004 commented 4 years ago

If you really don't want unnecessary object copying on return, consider using move semantic (std::move) instead of std::shared_ptr, and create an explicit move constructor for each class if needed. The syntax will be much more natural for others to read.

Eve-ning commented 4 years ago

shared_ptr is mainly used for polymorphism, not really focusing on performance atm. If anything, i'm using const ref for efficient moving