.. _program_listing_file_include_eigenpy_id.hpp: Program Listing for File id.hpp =============================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/eigenpy/id.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // // Copyright (c) 2024 INRIA // #ifndef __eigenpy_id_hpp__ #define __eigenpy_id_hpp__ #include #include namespace eigenpy { template struct IdVisitor : public bp::def_visitor > { template void visit(PyClass& cl) const { cl.def("id", &id, bp::arg("self"), "Returns the unique identity of an object.\n" "For object held in C++, it corresponds to its memory address."); } private: static boost::int64_t id(const C& self) { return boost::int64_t(reinterpret_cast(&self)); } }; } // namespace eigenpy #endif // ifndef __eigenpy_id_hpp__