mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-30 01:03:30 +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>
|
#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 Catch {
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
/**
|
/**
|
||||||
* A reimplementation of `std::unique_ptr` for improved compilation performance
|
* A reimplementation of `std::unique_ptr` for improved compilation performance
|
||||||
*
|
*
|
||||||
* Does not support arrays nor custom deleters, but has trivial ABI
|
* Does not support arrays nor custom deleters.
|
||||||
* when supposed by the compiler.
|
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class TRIVIAL_ABI unique_ptr {
|
class unique_ptr {
|
||||||
T* m_ptr;
|
T* m_ptr;
|
||||||
public:
|
public:
|
||||||
constexpr unique_ptr(std::nullptr_t = nullptr):
|
constexpr unique_ptr(std::nullptr_t = nullptr):
|
||||||
|
Loading…
Reference in New Issue
Block a user