1. 17 Aug, 2016 1 commit
    • Glen Walker's avatar
      Support keep_alive where nurse may be None · f45bb585
      Glen Walker authored
      For example keep_alive<0,1>() should work where the return value may sometimes be None. At present a "Could not allocate weak reference!" exception is thrown.
      Update documentation to clarify behaviour of keep_alive when nurse is None or does not support weak references.
      f45bb585
  2. 15 Aug, 2016 1 commit
    • Dean Moldovan's avatar
      Fix sphinx doc missing code blocks and warnings · aebca12b
      Dean Moldovan authored
      The missing empty line after `.. code-block::` resulted in incorrectly
      parsed restructuredtext (sphinx warnings) and the code blocks were not
      generated in the html output.
      
      The `exclude_patterns` change just silences the orphaned file warning.
      
      [ci skip]
      aebca12b
  3. 13 Aug, 2016 6 commits
  4. 12 Aug, 2016 1 commit
    • Jason Rhinelander's avatar
      Added pybind11::make_key_iterator for map iteration · 5aa85be2
      Jason Rhinelander authored
      This allows exposing a dict-like interface to python code, allowing
      iteration over keys via:
      
          for k in custommapping:
              ...
      
      while still allowing iteration over pairs, so that you can also
      implement 'dict.items()' functionality which returns a pair iterator,
      allowing:
      
          for k, v in custommapping.items():
              ...
      
      example-sequences-and-iterators is updated with a custom class providing
      both types of iteration.
      5aa85be2
  5. 10 Aug, 2016 2 commits
  6. 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
  7. 04 Aug, 2016 3 commits
  8. 01 Aug, 2016 1 commit
  9. 19 Jul, 2016 1 commit
  10. 18 Jul, 2016 2 commits
  11. 11 Jul, 2016 1 commit
  12. 10 Jul, 2016 1 commit
  13. 08 Jul, 2016 2 commits
  14. 30 Jun, 2016 2 commits
  15. 28 Jun, 2016 1 commit
  16. 22 Jun, 2016 2 commits
  17. 16 Jun, 2016 1 commit
  18. 03 Jun, 2016 3 commits
  19. 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
  20. 24 May, 2016 1 commit
  21. 21 May, 2016 1 commit
  22. 19 May, 2016 2 commits
  23. 15 May, 2016 2 commits