Commit 20f2d66c authored by Ronan's avatar Ronan
Browse files

feat(Utils): getPtr can deal with references

parent 24e4b233
...@@ -33,23 +33,23 @@ LINPHONE_BEGIN_NAMESPACE ...@@ -33,23 +33,23 @@ LINPHONE_BEGIN_NAMESPACE
namespace Utils { namespace Utils {
template<typename T> template<typename T>
LINPHONE_PUBLIC constexpr T *getPtr (const std::shared_ptr<T> &object) { LINPHONE_PUBLIC constexpr T *getPtr (std::shared_ptr<T> &object) {
return object.get(); return object.get();
} }
template<typename T> template<typename T>
LINPHONE_PUBLIC constexpr T *getPtr (T *object) { LINPHONE_PUBLIC constexpr T *getPtr (const std::shared_ptr<T> &object) {
return object; return object.get();
} }
template<typename T> template<typename T>
LINPHONE_PUBLIC constexpr const T *getPtr (const std::shared_ptr<const T> &object) { LINPHONE_PUBLIC constexpr T *getPtr (T *object) {
return object.get(); return object;
} }
template<typename T> template<typename T>
LINPHONE_PUBLIC constexpr const T *getPtr (const T *object) { LINPHONE_PUBLIC constexpr T *getPtr (T &object) {
return object; return &object;
} }
LINPHONE_PUBLIC bool iequals (const std::string &a, const std::string &b); LINPHONE_PUBLIC bool iequals (const std::string &a, const std::string &b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment