1. 27 Oct, 2016 2 commits
  2. 25 Oct, 2016 1 commit
    • Jason Rhinelander's avatar
      Prevent overwriting previous declarations · 6873c202
      Jason Rhinelander authored
      Currently pybind11 doesn't check when you define a new object (e.g. a
      class, function, or exception) that overwrites an existing one.  If the
      thing being overwritten is a class, this leads to a segfault (because
      pybind still thinks the type is defined, even though Python no longer
      has the type).  In other cases this is harmless (e.g. replacing a
      function with an exception), but even in that case it's most likely a
      bug.
      
      This code doesn't prevent you from actively doing something harmful,
      like deliberately overwriting a previous definition, but detects
      overwriting with a run-time error if it occurs in the standard
      class/function/exception/def registration interfaces.
      
      All of the additions are in non-template code; the result is actually a
      tiny decrease in .so size compared to master without the new test code
      (977304 to 977272 bytes), and about 4K higher with the new tests.
      6873c202
  3. 23 Oct, 2016 1 commit
  4. 21 Oct, 2016 1 commit
  5. 20 Oct, 2016 5 commits
  6. 14 Oct, 2016 1 commit
  7. 13 Oct, 2016 1 commit
  8. 12 Oct, 2016 3 commits
  9. 11 Oct, 2016 1 commit
  10. 09 Oct, 2016 2 commits
  11. 29 Sep, 2016 1 commit
  12. 27 Sep, 2016 1 commit
  13. 23 Sep, 2016 3 commits
  14. 22 Sep, 2016 1 commit
  15. 20 Sep, 2016 1 commit
  16. 19 Sep, 2016 2 commits
  17. 17 Sep, 2016 1 commit
  18. 16 Sep, 2016 1 commit
    • Jason Rhinelander's avatar
      Added py::register_exception for simple case (#296) · b3794f10
      Jason Rhinelander authored
      The custom exception handling added in PR #273 is robust, but is overly
      complex for declaring the most common simple C++ -> Python exception
      mapping that needs only to copy `what()`.  This add a simpler
      `py::register_exception<CppExp>(module, "PyExp");` function that greatly
      simplifies the common basic case of translation of a simple CppException
      into a simple PythonException, while not removing the more advanced
      capabilities of defining custom exception handlers.
      b3794f10
  19. 13 Sep, 2016 3 commits
  20. 11 Sep, 2016 3 commits
    • Jason Rhinelander's avatar
      Added a test to detect invalid RTTI caching · 0e489777
      Jason Rhinelander authored
      The current inheritance testing isn't sufficient to detect a cache
      failure; the test added here breaks PR #390, which caches the
      run-time-determined return type the first time a function is called,
      then reuses that cached type even though the run-time type could be
      different for a future call.
      0e489777
    • Jason Rhinelander's avatar
      Update OVERLOAD macros to support ref/ptr return type overloads · 7dfb932e
      Jason Rhinelander authored
      This adds a static local variable (in dead code unless actually needed)
      in the overload code that is used for storage if the overload is for
      some convert-by-value type (such as numeric values or std::string).
      
      This has limitations (as written up in the advanced doc), but is better
      than simply not being able to overload reference or pointer methods.
      7dfb932e
    • Jason Rhinelander's avatar
      Use 'override' rather than 'virtual' for overrides · 116d37c9
      Jason Rhinelander authored
      Minor change that makes this example more compliant with the C++ Core
      Guidelines.
      116d37c9
  21. 10 Sep, 2016 5 commits