1. 05 Aug, 2016 2 commits
    • Jason Rhinelander's avatar
      virtual + inheritance example: remove multiple inheritance approach · d6c365bc
      Jason Rhinelander authored
      It was already pretty badly intrusive, but it also appears to make MSVC
      segfault.  Rather than investigating and fixing it, it's easier to just
      remove it.
      d6c365bc
    • Jason Rhinelander's avatar
      Added advanced doc section on virtual methods + inheritance · 0ca96e29
      Jason Rhinelander authored
      As discussed in #320.
      
      The adds a documentation block that mentions that the trampoline classes
      must provide overrides for both the classes' own virtual methods *and*
      any inherited virtual methods.  It also provides a templated solution to
      avoiding method duplication.
      
      The example includes a third method (only mentioned in the "see also"
      section of the documentation addition), using multiple inheritance.
      While this approach works, and avoids code generation in deep
      hierarchies, it is intrusive by requiring that the wrapped classes use
      virtual inheritance, which itself is more instrusive if any of the
      virtual base classes need anything other than default constructors.  As
      per the discussion in #320, it is kept as an example, but not suggested
      in the documentation.
      0ca96e29
  2. 04 Aug, 2016 3 commits
  3. 01 Aug, 2016 1 commit
  4. 19 Jul, 2016 1 commit
  5. 18 Jul, 2016 2 commits
  6. 11 Jul, 2016 1 commit
  7. 10 Jul, 2016 1 commit
  8. 08 Jul, 2016 2 commits
  9. 30 Jun, 2016 2 commits
  10. 28 Jun, 2016 1 commit
  11. 22 Jun, 2016 2 commits
  12. 16 Jun, 2016 1 commit
  13. 03 Jun, 2016 3 commits
  14. 26 May, 2016 1 commit
    • Wenzel Jakob's avatar
      Redesigned virtual call mechanism and user-facing syntax (breaking change!) · 86d825f3
      Wenzel Jakob authored
      Sergey Lyskov pointed out that the trampoline mechanism used to override
      virtual methods from within Python caused unnecessary overheads when
      instantiating the original (i.e. non-extended) class.
      
      This commit removes this inefficiency, but some syntax changes were
      needed to achieve this. Projects using this features will need to make a
      few changes:
      
      In particular, the example below shows the old syntax to instantiate a
      class with a trampoline:
      
      class_<TrampolineClass>("MyClass")
          .alias<MyClass>()
          ....
      
      This is what should be used now:
      
      class_<MyClass, std::unique_ptr<MyClass, TrampolineClass>("MyClass")
          ....
      
      Importantly, the trampoline class is now specified as the *third*
      argument to the class_ template, and the alias<..>() call is gone. The
      second argument with the unique pointer is simply the default holder
      type used by pybind11.
      86d825f3
  15. 24 May, 2016 1 commit
  16. 21 May, 2016 1 commit
  17. 19 May, 2016 2 commits
  18. 15 May, 2016 2 commits
  19. 05 May, 2016 3 commits
  20. 04 May, 2016 1 commit
    • Wenzel Jakob's avatar
      redesigned format_descriptor<> and npy_format_descriptor<> · 876eeab4
      Wenzel Jakob authored
      This somewhat heavyweight solution will avoid size_t/long long/long/int
      mismatches on various platforms once and for all. The previous template
      overloads could e.g. not handle size_t on Darwin.
      
      One gotcha: the 'format_descriptor<T>::value()' syntax changed to just
      'format_descriptor<T>::value'
      876eeab4
  21. 01 May, 2016 1 commit
  22. 30 Apr, 2016 1 commit
  23. 28 Apr, 2016 2 commits
  24. 26 Apr, 2016 1 commit
  25. 25 Apr, 2016 1 commit
  26. 22 Apr, 2016 1 commit