mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 07:02:11 +00:00
Help CLion IDE evaluate PYBIND11_NUMPY_DTYPE
CLion slows to a crawl when evaluating the intricate `PYBIND11_NUMPY_DTYPE` macro. This commit replaces the macro cascade with a simple `(void)0` to ease IDE evaluation.
This commit is contained in:
parent
e067c5842b
commit
24dec80b44
@ -1147,6 +1147,11 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __CLION_IDE__ // replace heavy macro with dummy code for the IDE (doesn't affect code)
|
||||
# define PYBIND11_NUMPY_DTYPE(Type, ...) ((void)0)
|
||||
# define PYBIND11_NUMPY_DTYPE_EX(Type, ...) ((void)0)
|
||||
#else
|
||||
|
||||
#define PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name) \
|
||||
::pybind11::detail::field_descriptor { \
|
||||
Name, offsetof(T, Field), sizeof(decltype(std::declval<T>().Field)), \
|
||||
@ -1214,6 +1219,8 @@ private:
|
||||
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
|
||||
({PYBIND11_MAP2_LIST (PYBIND11_FIELD_DESCRIPTOR_EX, Type, __VA_ARGS__)})
|
||||
|
||||
#endif // __CLION_IDE__
|
||||
|
||||
template <class T>
|
||||
using array_iterator = typename std::add_pointer<T>::type;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user