Skip to content
Raul Metsma edited this page Nov 2, 2016 · 11 revisions

Code Best Practices

  • Store openssl objects std::shared_ptr. Shared pointer keeps reference count and when coping objects the shared_ptr's inside both objects will be referring to the same underlying object. Also C++11 handles move operators.
  • Avoid third party library includes (openssl, xerces-c...) in headers, especially public headers. Use forward declaration when needed. It also speeds up build and do not require third party developers adjust include paths.
Clone this wiki locally