mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Improve documentation on Detail::unique_ptr
This commit is contained in:
parent
1d79683ea8
commit
77c7e9803e
@ -22,9 +22,12 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
// reimplementation of unique_ptr for improved compilation times
|
/**
|
||||||
// Does not support custom deleters (and thus does not require EBO)
|
* A reimplementation of `std::unique_ptr` for improved compilation performance
|
||||||
// Does not support arrays
|
*
|
||||||
|
* Does not support arrays nor custom deleters, but has trivial ABI
|
||||||
|
* when supposed by the compiler.
|
||||||
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class TRIVIAL_ABI unique_ptr {
|
class TRIVIAL_ABI unique_ptr {
|
||||||
T* m_ptr;
|
T* m_ptr;
|
||||||
@ -107,10 +110,7 @@ namespace Detail {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Purposefully doesn't exist
|
//! Specialization to cause compile-time error for arrays
|
||||||
// We could also rely on compiler warning + werror for calling plain delete
|
|
||||||
// on a T[], but this seems better.
|
|
||||||
// Maybe add definition and a static assert?
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class unique_ptr<T[]>;
|
class unique_ptr<T[]>;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user