1. 19 Jul, 2018 1 commit
    • Fix compatibility with catch v2 · f7bc18f5
      Catch v2 changed the `run(...)` signature to take a `char *argv[]`,
      arguing partly that technically a `char *argv[]` type is the correct
      `main()` signature rather than `const char *argv[]`.
      
      Dropping the `const` here doesn't appear to cause any problems with
      catch v1 (tested against both the cmake-downloaded 1.9.3 and Debian's
      1.12.1 package) so we can follow suit.
      Jason Rhinelander committed
  2. 17 Jul, 2018 4 commits
  3. 24 Jun, 2018 4 commits
  4. 21 Jun, 2018 2 commits
  5. 15 Jun, 2018 1 commit
  6. 24 May, 2018 1 commit
  7. 18 May, 2018 1 commit
  8. 07 May, 2018 1 commit
  9. 06 May, 2018 3 commits
  10. 29 Apr, 2018 2 commits
  11. 24 Apr, 2018 1 commit
  12. 22 Apr, 2018 2 commits
  13. 16 Apr, 2018 1 commit
  14. 14 Apr, 2018 1 commit
    • Add basic support for tag-based static polymorphism (#1326) · fd9bc8f5
      * Add basic support for tag-based static polymorphism
      
      Sometimes it is possible to look at a C++ object and know what its dynamic type is,
      even if it doesn't use C++ polymorphism, because instances of the object and its
      subclasses conform to some other mechanism for being self-describing; for example,
      perhaps there's an enumerated "tag" or "kind" member in the base class that's always
      set to an indication of the correct type. This might be done for performance reasons,
      or to permit most-derived types to be trivially copyable. One of the most widely-known
      examples is in LLVM: https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html
      
      This PR permits pybind11 to be informed of such conventions via a new specializable
      detail::polymorphic_type_hook<> template, which generalizes the previous logic for
      determining the runtime type of an object based on C++ RTTI. Implementors provide
      a way to map from a base class object to a const std::type_info* for the dynamic
      type; pybind11 then uses this to ensure that casting a Base* to Python creates a
      Python object that knows it's wrapping the appropriate sort of Derived.
      
      There are a number of restrictions with this tag-based static polymorphism support
      compared to pybind11's existing support for built-in C++ polymorphism:
      
      - there is no support for this-pointer adjustment, so only single inheritance is permitted
      - there is no way to make C++ code call new Python-provided subclasses
      - when binding C++ classes that redefine a method in a subclass, the .def() must be
        repeated in the binding for Python to know about the update
      
      But these are not much of an issue in practice in many cases, the impact on the
      complexity of pybind11's innards is minimal and localized, and the support for
      automatic downcasting improves usability a great deal.
      oremanj committed
  15. 09 Apr, 2018 1 commit
  16. 07 Apr, 2018 1 commit
    • Implement an enum_ property "name" · 289e5d9c
      The property returns the enum_ value as a string.
      For example:
      
      >>> import module
      >>> module.enum.VALUE
      enum.VALUE
      >>> str(module.enum.VALUE)
      'enum.VALUE'
      >>> module.enum.VALUE.name
      'VALUE'
      
      This is actually the equivalent of Boost.Python "name" property.
      Boris Staletic committed
  17. 05 Apr, 2018 1 commit
  18. 03 Apr, 2018 2 commits
  19. 11 Mar, 2018 1 commit
  20. 10 Mar, 2018 4 commits
  21. 28 Feb, 2018 2 commits
  22. 18 Feb, 2018 1 commit
  23. 07 Feb, 2018 1 commit
  24. 06 Feb, 2018 1 commit