Line |
Branch |
Exec |
Source |
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 |
|
|
|
13 |
|
|
/// \brief Compares two std::shared_ptr |
14 |
|
|
/// |
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__ |
27 |
|
|
|