mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
mark some types in std as trivially_relocatable
This commit is contained in:
parent
457b0d38bf
commit
458dd32af8
@ -190,6 +190,26 @@ namespace pkpy {
|
|||||||
constexpr inline bool is_trivially_relocatable_v =
|
constexpr inline bool is_trivially_relocatable_v =
|
||||||
TriviallyRelocatable<T>::value;
|
TriviallyRelocatable<T>::value;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct TriviallyRelocatable<std::unique_ptr<T>>{
|
||||||
|
constexpr static bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct TriviallyRelocatable<std::shared_ptr<T>>{
|
||||||
|
constexpr static bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct TriviallyRelocatable<std::weak_ptr<T>>{
|
||||||
|
constexpr static bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct TriviallyRelocatable<std::vector<T>>{
|
||||||
|
constexpr static bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
// the implementation of small_vector
|
// the implementation of small_vector
|
||||||
template <typename T, std::size_t N> class small_vector {
|
template <typename T, std::size_t N> class small_vector {
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user