35 (
static_cast<T *
>(
ptr))->~T();
39 T *ptr_ =
static_cast<T *
>(
ptr);
40 mask.foreach_index([&](
int64_t i) { ptr_[i].~T(); });
45 *
static_cast<T *
>(dst) = *
static_cast<const T *
>(
src);
49 const T *src_ =
static_cast<const T *
>(
src);
50 T *dst_ =
static_cast<T *
>(dst);
52 mask.foreach_index([&](
int64_t i) { dst_[i] = src_[i]; });
56 const T *src_ =
static_cast<const T *
>(
src);
57 T *dst_ =
static_cast<T *
>(dst);
59 mask.to_best_mask_type([&](
auto best_mask) {
61 dst_[i] = src_[best_mask[i]];
72 const T *src_ =
static_cast<const T *
>(
src);
73 T *dst_ =
static_cast<T *
>(dst);
75 mask.foreach_index([&](
int64_t i) {
new (dst_ + i)
T(src_[i]); });
79 const T *src_ =
static_cast<const T *
>(
src);
80 T *dst_ =
static_cast<T *
>(dst);
82 mask.to_best_mask_type([&](
auto best_mask) {
84 new (dst_ + i)
T(src_[best_mask[i]]);
95 T *src_ =
static_cast<T *
>(
src);
96 T *dst_ =
static_cast<T *
>(dst);
98 mask.foreach_index([&](
int64_t i) { dst_[i] = std::move(src_[i]); });
107 T *src_ =
static_cast<T *
>(
src);
108 T *dst_ =
static_cast<T *
>(dst);
110 mask.foreach_index([&](
int64_t i) {
new (dst_ + i)
T(std::move(src_[i])); });
115 T *src_ =
static_cast<T *
>(
src);
116 T *dst_ =
static_cast<T *
>(dst);
118 *dst_ = std::move(*src_);
123 T *src_ =
static_cast<T *
>(
src);
124 T *dst_ =
static_cast<T *
>(dst);
127 dst_[i] = std::move(src_[i]);
134 T *src_ =
static_cast<T *
>(
src);
135 T *dst_ =
static_cast<T *
>(dst);
137 new (dst_)
T(std::move(*src_));
142 T *src_ =
static_cast<T *
>(
src);
143 T *dst_ =
static_cast<T *
>(dst);
146 new (dst_ + i)
T(std::move(src_[i]));
153 const T &value_ = *
static_cast<const T *
>(value);
154 T *dst_ =
static_cast<T *
>(dst);
156 for (
int64_t i = 0; i < n; i++) {
162 const T &value_ = *
static_cast<const T *
>(value);
163 T *dst_ =
static_cast<T *
>(dst);
165 mask.foreach_index([&](
int64_t i) { dst_[i] = value_; });
170 const T &value_ = *
static_cast<const T *
>(value);
171 T *dst_ =
static_cast<T *
>(dst);
173 for (
int64_t i = 0; i < n; i++) {
174 new (dst_ + i)
T(value_);
179 const T &value_ = *
static_cast<const T *
>(value);
180 T *dst_ =
static_cast<T *
>(dst);
182 mask.foreach_index([&](
int64_t i) {
new (dst_ + i)
T(value_); });
185 template<
typename T>
void print_cb(
const void *value, std::stringstream &ss)
187 const T &value_ = *
static_cast<const T *
>(value);
193 const T &a_ = *
static_cast<const T *
>(
a);
194 const T &b_ = *
static_cast<const T *
>(
b);
200 const T &value_ = *
static_cast<const T *
>(value);
208 template<
typename T, CPPTypeFlags Flags>
211 using namespace cpp_type_util;
213 debug_name_ = debug_name;
216 is_trivial_ = std::is_trivial_v<T>;
217 is_trivially_destructible_ = std::is_trivially_destructible_v<T>;
218 if constexpr (std::is_default_constructible_v<T>) {
219 default_construct_ = default_construct_cb<T>;
220 default_construct_indices_ = default_construct_indices_cb<T>;
221 value_initialize_ = value_initialize_cb<T>;
222 value_initialize_indices_ = value_initialize_indices_cb<T>;
226 if constexpr (std::is_destructible_v<T>) {
227 destruct_ = destruct_cb<T>;
228 destruct_indices_ = destruct_indices_cb<T>;
230 if constexpr (std::is_copy_assignable_v<T>) {
231 copy_assign_ = copy_assign_cb<T>;
232 copy_assign_indices_ = copy_assign_indices_cb<T>;
233 copy_assign_compressed_ = copy_assign_compressed_cb<T>;
235 if constexpr (std::is_copy_constructible_v<T>) {
236 copy_construct_ = copy_construct_cb<T>;
237 copy_construct_indices_ = copy_construct_indices_cb<T>;
238 copy_construct_compressed_ = copy_construct_compressed_cb<T>;
240 if constexpr (std::is_move_assignable_v<T>) {
241 move_assign_ = move_assign_cb<T>;
242 move_assign_indices_ = move_assign_indices_cb<T>;
244 if constexpr (std::is_move_constructible_v<T>) {
245 move_construct_ = move_construct_cb<T>;
246 move_construct_indices_ = move_construct_indices_cb<T>;
248 if constexpr (std::is_destructible_v<T>) {
249 if constexpr (std::is_move_assignable_v<T>) {
250 relocate_assign_ = relocate_assign_cb<T>;
251 relocate_assign_indices_ = relocate_assign_indices_cb<T>;
253 if constexpr (std::is_move_constructible_v<T>) {
254 relocate_construct_ = relocate_construct_cb<T>;
255 relocate_construct_indices_ = relocate_construct_indices_cb<T>;
258 if constexpr (std::is_copy_assignable_v<T>) {
259 fill_assign_indices_ = fill_assign_indices_cb<T>;
261 if constexpr (std::is_copy_constructible_v<T>) {
262 fill_construct_indices_ = fill_construct_indices_cb<T>;
268 print_ = print_cb<T>;
271 is_equal_ = is_equal_cb<T>;
275 has_special_member_functions_ = (default_construct_ && copy_construct_ && copy_assign_ &&
276 move_construct_ && move_assign_ && destruct_);
281 #define BLI_CPP_TYPE_MAKE(IDENTIFIER, TYPE_NAME, FLAGS) \
282 template<> const blender::CPPType &blender::CPPType::get_impl<TYPE_NAME>() \
284 static CPPType cpp_type{blender::CPPTypeParam<TYPE_NAME, FLAGS>(), STRINGIFY(IDENTIFIER)}; \
CPPType(CPPTypeParam< T, Flags >, StringRef debug_name)
const void * default_value() const
SyclQueue void void * src
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void move_assign_cb(void *src, void *dst)
void relocate_assign_indices_cb(void *src, void *dst, IndexMask mask)
void fill_assign_indices_cb(const void *value, void *dst, IndexMask mask)
void default_construct_indices_cb(void *ptr, IndexMask mask)
void copy_construct_indices_cb(const void *src, void *dst, IndexMask mask)
void copy_assign_compressed_cb(const void *src, void *dst, IndexMask mask)
void fill_construct_indices_cb(const void *value, void *dst, IndexMask mask)
void relocate_construct_cb(void *src, void *dst)
void copy_construct_compressed_cb(const void *src, void *dst, IndexMask mask)
void value_initialize_cb(void *ptr)
void move_assign_indices_cb(void *src, void *dst, IndexMask mask)
void copy_construct_cb(const void *src, void *dst)
void print_cb(const void *value, std::stringstream &ss)
void relocate_assign_cb(void *src, void *dst)
void move_construct_indices_cb(void *src, void *dst, IndexMask mask)
void value_initialize_indices_cb(void *ptr, IndexMask mask)
void fill_assign_cb(const void *value, void *dst, int64_t n)
bool is_equal_cb(const void *a, const void *b)
void copy_assign_cb(const void *src, void *dst)
void destruct_cb(void *ptr)
void destruct_indices_cb(void *ptr, IndexMask mask)
void fill_construct_cb(const void *value, void *dst, int64_t n)
uint64_t hash_cb(const void *value)
void relocate_construct_indices_cb(void *src, void *dst, IndexMask mask)
void default_construct_cb(void *ptr)
void copy_assign_indices_cb(const void *src, void *dst, IndexMask mask)
void move_construct_cb(void *src, void *dst)
void initialized_move_n(T *src, int64_t n, T *dst)
uint64_t get_default_hash(const T &v)
void uninitialized_copy_n(const T *src, int64_t n, T *dst)
void uninitialized_move_n(T *src, int64_t n, T *dst)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
_W64 unsigned int uintptr_t
unsigned __int64 uint64_t