Skip to content

Commit

Permalink
usd: Windows lambda implicit conversion to function pointer seems
Browse files Browse the repository at this point in the history
non-conforming.

(Internal change: 1733001)
  • Loading branch information
gitamohr authored and pixar-oss committed Apr 5, 2017
1 parent 000ea81 commit 399bb74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pxr/usd/lib/usd/wrapPrimRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@ void wrapUsdPrimRange()
;

class_<Usd_PyPrimRangeIterator>("_Iterator", no_init)
// This a lambda that does nothing cast to a function pointer.
.def("__iter__", +[](Usd_PyPrimRangeIterator){}, return_self<>())
// This is a lambda that does nothing cast to a function pointer.
// All we want is to return 'self'.
.def("__iter__", static_cast<void (*)(Usd_PyPrimRangeIterator)>
([](Usd_PyPrimRangeIterator){}), return_self<>())
.def("next", &Usd_PyPrimRangeIterator::next)
.def("IsPostVisit", &Usd_PyPrimRangeIterator::IsPostVisit)
.def("PruneChildren", &Usd_PyPrimRangeIterator::PruneChildren)
Expand Down

1 comment on commit 399bb74

@meshula
Copy link
Member

@meshula meshula commented on 399bb74 Apr 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth filing a bug with Microsoft on this one. They've been fairly responsive in the past on this sort of thing.

Please sign in to comment.