mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Tear out trivial_abi on unique_ptr
Turns out people are bad at not combining code compiled with GCC and Clang, and the improvement from `trivial_abi` on `unique_ptr` is not worth the maintenance cost of having this be an opt-in change. Closes #2344
This commit is contained in:
parent
103cb16696
commit
fff494c10a
@ -13,25 +13,15 @@
|
||||
|
||||
#include <catch2/internal/catch_move_and_forward.hpp>
|
||||
|
||||
#if defined(__clang__) && defined(__has_attribute)
|
||||
# if __has_attribute(trivial_abi)
|
||||
# define TRIVIAL_ABI [[clang::trivial_abi]]
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(TRIVIAL_ABI)
|
||||
# define TRIVIAL_ABI
|
||||
#endif
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
/**
|
||||
* A reimplementation of `std::unique_ptr` for improved compilation performance
|
||||
*
|
||||
* Does not support arrays nor custom deleters, but has trivial ABI
|
||||
* when supposed by the compiler.
|
||||
* Does not support arrays nor custom deleters.
|
||||
*/
|
||||
template <typename T>
|
||||
class TRIVIAL_ABI unique_ptr {
|
||||
class unique_ptr {
|
||||
T* m_ptr;
|
||||
public:
|
||||
constexpr unique_ptr(std::nullptr_t = nullptr):
|
||||
|
Loading…
Reference in New Issue
Block a user