From 74cd7a66353016ed259a32e096ecc86aba9efc00 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 3 Jul 2024 08:36:18 -0400 Subject: [PATCH] Clean up some documentation for user pointers. --- include/deal.II/grid/tria_accessor.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index b8f7dc8e46..ef3cf0e2ac 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -1356,7 +1356,7 @@ public: set_user_pointer(void *p) const; /** - * Reset the user pointer to a @p nullptr pointer. See + * Reset the user pointer to `nullptr`. See * @ref GlossUserData * for more information. */ @@ -1365,14 +1365,16 @@ public: /** * Access the value of the user pointer. It is in the responsibility of the - * user to make sure that the pointer points to something useful. You should - * use the new style cast operator to maintain a minimum of type safety, - * e.g. + * user to make sure that the pointer points to something useful and always + * requires casting to a known type, e.g., * - * @note User pointers and user indices are mutually exclusive. Therefore, - * you can only use one of them, unless you call - * Triangulation::clear_user_data() in between. A - * *a=static_cast(cell->user_pointer());. + * @code + * auto *a = static_cast(cell->user_pointer()); + * @endcode + * + * @note User pointers and user indices are mutually exclusive. Therefore, you + * can only use one of them, unless you call Triangulation::clear_user_data() + * in between. * * See * @ref GlossUserData @@ -2680,7 +2682,7 @@ public: set_user_pointer(void *p) const; /** - * Reset the user pointer to a @p nullptr pointer. See + * Reset the user pointer to `nullptr`. See * @ref GlossUserData * for more information. */ -- 2.39.5