doc, wifi: (fixes #1158) Reintroduce WifiPpdu's destructor due to PIMPL
Also add reference explaining why declaring a default destructor in the header is a problem
This commit is contained in:
@@ -1512,6 +1512,16 @@ for more details.
|
||||
|
||||
- Avoid declaring trivial destructors, to optimize performance.
|
||||
|
||||
.. _When an empty destructor is required: https://andreasfertig.com/blog/2023/12/when-an-empty-destructor-is-required/
|
||||
|
||||
- When declaring default destructors with ``~Class() = default;``, be aware
|
||||
that classes derived from ``SimpleRefCount<T>`` must have this declaration
|
||||
on the source file (``.cc``). The header file (``.h``) should contain
|
||||
the plain destructor declaration ``~Class();``. This is due to PIMPL's
|
||||
opaque pointer, as explained in Andrea Fertig's blog post
|
||||
`When an empty destructor is required`_.
|
||||
See class WifiPpdu's destructor for an example.
|
||||
|
||||
C++ standard
|
||||
============
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ WifiPpdu::WifiPpdu(const WifiConstPsduMap& psdus,
|
||||
m_psdus = psdus;
|
||||
}
|
||||
|
||||
WifiPpdu::~WifiPpdu() = default;
|
||||
|
||||
const WifiTxVector&
|
||||
WifiPpdu::GetTxVector() const
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ class WifiPpdu : public SimpleRefCount<WifiPpdu>
|
||||
/**
|
||||
* Destructor for WifiPpdu.
|
||||
*/
|
||||
virtual ~WifiPpdu() = default;
|
||||
virtual ~WifiPpdu();
|
||||
|
||||
/**
|
||||
* Get the TXVECTOR used to send the PPDU.
|
||||
|
||||
Reference in New Issue
Block a user