Bug #4248
closedMissing explicit instantiation declarations for wireEncode function templates
100%
Description
Currently, the wireEncode(EncodingImpl<T>&)
function templates are forward declared in header files, but their definitions, along with two explicit instantiations, appear in the .cpp
files only.
Such code is illegal unless every use of the function template that would trigger an implicit instantiation is preceded by an explicit instantiation declaration (extern template
).
Updated by Junxiao Shi about 7 years ago
- Assignee set to Davide Pesavento
https://gerrit.named-data.net/4124 attempts to fix this issue, but there are Doxygen errors.
Actually I tried this before but Doxygen won't let me pass...
Updated by Davide Pesavento about 7 years ago
- Subject changed from wireEncode specialization should appear in headers to Missing explicit instantiation declarations for wireEncode function templates
- Description updated (diff)
Updated by Davide Pesavento about 7 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 50
Updated by Davide Pesavento about 7 years ago
- Status changed from In Progress to Feedback
- Priority changed from Normal to Low
Updated by Davide Pesavento about 7 years ago
Can we use #ifdef
to hide the declarations from doxygen?
Updated by Junxiao Shi about 7 years ago
I prefer a solution of changing Doxygen or CI config to ignore such warnings.
Can we use
#ifdef
to hide the declarations from doxygen?
It looks ugly. It would be better to declare a NDN_SPECIALIZE_WIRE_ENCODE
macro:
NDN_SPECIALIZE_WIRE_ENCODE(Selectors);
This macro could be declared differently depending on Doxygen or not. It only needs to handle the most common case where wireEncode
takes one parameter of either EncodingBuffer or Estimator. A handful of classes including Data
would need manual specialization with #ifndef DOXYGEN
.
Updated by Davide Pesavento about 7 years ago
Junxiao Shi wrote:
I prefer a solution of changing Doxygen or CI config to ignore such warnings.
Please suggest a specific solution. I don't have access to the CI config and I have no idea how that thing works.
Can we use
#ifdef
to hide the declarations from doxygen?It looks ugly. It would be better to declare a
NDN_SPECIALIZE_WIRE_ENCODE
macro:
A pair of #ifndef
/#endif
looks ugly? Bah... Anyway, if it makes you happy, I can write a macro. (btw it's an instantiation, not specialization)
Updated by Junxiao Shi about 7 years ago
A pair of
#ifndef
/#endif
looks ugly?
In fact, the whole specialization thingy looks ugly because it's basically repeated code in every file (either .hpp or .cpp). #ifndef
adds to that mess. Having a macro covers most cases.
Updated by Davide Pesavento about 7 years ago
- Status changed from Feedback to In Progress
Updated by Davide Pesavento about 7 years ago
- Status changed from In Progress to Code review
- % Done changed from 80 to 100
Updated by Davide Pesavento about 7 years ago
- Status changed from Code review to Closed