pinocchio  3.3.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
shared-ptr.hpp
1 //
2 // Copyright (c) 2023 INRIA
3 //
4 
5 #ifndef __pinocchio_utils_shared_ptr_hpp__
6 #define __pinocchio_utils_shared_ptr_hpp__
7 
8 #include <memory>
9 
10 namespace pinocchio
11 {
12 
15  template<typename T>
16  bool compare_shared_ptr(const std::shared_ptr<T> & ptr1, const std::shared_ptr<T> & ptr2)
17  {
18  if (ptr1 == ptr2)
19  return true;
20  if (ptr1 && ptr2)
21  return *ptr1.get() == *ptr2.get();
22  return false;
23  }
24 } // namespace pinocchio
25 
26 #endif // ifndef __pinocchio_utils_shared_ptr_hpp__
Main pinocchio namespace.
Definition: treeview.dox:11
bool compare_shared_ptr(const std::shared_ptr< T > &ptr1, const std::shared_ptr< T > &ptr2)
Compares two std::shared_ptr.
Definition: shared-ptr.hpp:16