shared-ptr.hpp
Go to the documentation of this file.
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__
pinocchio::compare_shared_ptr
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
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:04