Skip to content

Commit

Permalink
Add symtab/Type-mem.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 90eb97e commit ba36b11
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 17 additions & 0 deletions docs/symtabAPI/developer/Type-mem.h.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
.. _`sec:Type-mem.h`:

Type-mem.h
##########

.. cpp:namespace:: Dyninst::SymtabAPI

.. cpp:function:: template<class T> T *upgradePlaceholder(Type *placeholder, T *new_type)

.. cpp:namespace-push:: dev

.. cpp:function:: template<class T> typename boost::enable_if<\
boost::integral_constant<bool, !bool(boost::is_same<Type, T>::value)>, \
boost::shared_ptr<Type>>::type \
typeCollection::addOrUpdateType(boost::shared_ptr<T> type)

Instantiating this function for ``Type`` would be a mistake, which
the following assert tries to guard against. If you trigger this,
then a caller to this function is likely using ``Type``. Change
this to a more specific call, e.g. :cpp:class:`typeFunction` instead of ``Type``.

.. cpp:namespace-pop::
4 changes: 0 additions & 4 deletions symtabAPI/src/Type-mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ typename boost::enable_if<
boost::integral_constant<bool, !bool(boost::is_same<Type, T>::value)>,
boost::shared_ptr<Type>>::type typeCollection::addOrUpdateType(boost::shared_ptr<T> type)
{
//Instanciating this function for 'Type' would be a mistake, which
//the following assert tries to guard against. If you trigger this,
//then a caller to this function is likely using 'Type'. Change
//this to a more specific call, e.g. typeFunction instead of Type
// NOTE: Disabled, we use SFINAE instead to handle this.
// BOOST_STATIC_ASSERT(sizeof(T) != sizeof(Type));

Expand Down

0 comments on commit ba36b11

Please sign in to comment.