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.
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.