Skip to content

Commit 6552b9a

Browse files
committed
core: avoid duplicate registration
1 parent e576541 commit 6552b9a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/type_info.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88
#include <boost/python.hpp>
99
#include <boost/type_index.hpp>
1010

11+
#include "eigenpy/registration.hpp"
12+
1113
namespace bp = boost::python;
1214

15+
namespace eigenpy {
16+
1317
void exposeStdTypeIndex() {
1418
typedef std::type_index Self;
19+
if (register_symbolic_link_to_registered_type<Self>()) return;
20+
1521
bp::class_<Self>(
1622
"std_type_index",
1723
"The class type_index holds implementation-specific information about a "
@@ -42,6 +48,8 @@ void exposeStdTypeIndex() {
4248

4349
void exposeBoostTypeIndex() {
4450
typedef boost::typeindex::type_index Self;
51+
if (register_symbolic_link_to_registered_type<Self>()) return;
52+
4553
bp::class_<Self>(
4654
"boost_type_index",
4755
"The class type_index holds implementation-specific information about a "
@@ -66,7 +74,6 @@ void exposeBoostTypeIndex() {
6674
"Human readible name.");
6775
}
6876

69-
namespace eigenpy {
7077
void exposeTypeInfo() {
7178
exposeStdTypeIndex();
7279
exposeBoostTypeIndex();

0 commit comments

Comments
 (0)