mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
Fixes for compilation/segfault problems with Intel (issue 94)
This commit is contained in:
parent
f8584b630b
commit
0b6cff3d1d
@ -277,7 +277,7 @@ template <int Nurse, int Patient> struct process_attribute<keep_alive<Nurse, Pat
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Ignore that a variable is unused in compiler warnings
|
/// Ignore that a variable is unused in compiler warnings
|
||||||
template<class T> void ignore_unused(const T&) { }
|
inline void ignore_unused(const int *) { }
|
||||||
|
|
||||||
/// Recursively iterate over variadic template arguments
|
/// Recursively iterate over variadic template arguments
|
||||||
template <typename... Args> struct process_attributes {
|
template <typename... Args> struct process_attributes {
|
||||||
|
@ -519,9 +519,16 @@ public:
|
|||||||
|
|
||||||
explicit operator type*() { return this->value; }
|
explicit operator type*() { return this->value; }
|
||||||
explicit operator type&() { return *(this->value); }
|
explicit operator type&() { return *(this->value); }
|
||||||
explicit operator holder_type&() { return holder; }
|
|
||||||
explicit operator holder_type*() { return &holder; }
|
explicit operator holder_type*() { return &holder; }
|
||||||
|
|
||||||
|
// Workaround for Intel compiler bug
|
||||||
|
// see pybind11 issue 94
|
||||||
|
#if defined(__ICC) || defined(__INTEL_COMPILER)
|
||||||
|
operator holder_type&() { return holder; }
|
||||||
|
#else
|
||||||
|
explicit operator holder_type&() { return holder; }
|
||||||
|
#endif
|
||||||
|
|
||||||
static handle cast(const holder_type &src, return_value_policy policy, handle parent) {
|
static handle cast(const holder_type &src, return_value_policy policy, handle parent) {
|
||||||
return type_caster_generic::cast(
|
return type_caster_generic::cast(
|
||||||
src.get(), policy, parent, &typeid(type), ©_constructor, &src);
|
src.get(), policy, parent, &typeid(type), ©_constructor, &src);
|
||||||
|
Loading…
Reference in New Issue
Block a user