Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/FN_cpp_type.hh
| Show First 20 Lines • Show All 660 Lines • ▼ Show 20 Lines | public: | ||||
| uint64_t hash() const | uint64_t hash() const | ||||
| { | { | ||||
| return get_default_hash(this); | return get_default_hash(this); | ||||
| } | } | ||||
| template<typename T> bool is() const | template<typename T> bool is() const | ||||
| { | { | ||||
| return this == &CPPType::get<T>(); | return this == &CPPType::get<std::decay_t<T>>(); | ||||
| } | } | ||||
| }; | }; | ||||
| } // namespace blender::fn | } // namespace blender::fn | ||||
| /* Utility for allocating an uninitialized buffer for a single value of the given #CPPType. */ | /* Utility for allocating an uninitialized buffer for a single value of the given #CPPType. */ | ||||
| #define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name) \ | #define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name) \ | ||||
| blender::DynamicStackBuffer<64, 64> stack_buffer_for_##variable_name((type).size(), \ | blender::DynamicStackBuffer<64, 64> stack_buffer_for_##variable_name((type).size(), \ | ||||
| (type).alignment()); \ | (type).alignment()); \ | ||||
| void *variable_name = stack_buffer_for_##variable_name.buffer(); | void *variable_name = stack_buffer_for_##variable_name.buffer(); | ||||