1. 21 Sep, 2017 1 commit
    • Ansgar Burchardt's avatar
      correct stride in matrix example and test · a22dd2d1
      Ansgar Burchardt authored
      This also matches the Eigen example for the row-major case.
      
      This also enhances one of the tests to trigger a failure (and fixes it in the PR).  (This isn't really a flaw in pybind itself, but rather fixes wrong code in the test code and docs).
      a22dd2d1
  2. 16 Sep, 2017 1 commit
    • Dean Moldovan's avatar
      Use semi-constexpr signatures on MSVC · 56613945
      Dean Moldovan authored
      MSCV does not allow `&typeid(T)` in constexpr contexts, but the string
      part of the type signature can still be constexpr. In order to avoid
      `typeid` as long as possible, `descr` is modified to collect type
      information as template parameters instead of constexpr `typeid`.
      The actual `std::type_info` pointers are only collected in the end,
      as a `constexpr` (gcc/clang) or regular (MSVC) function call.
      
      Not only does it significantly reduce binary size on MSVC, gcc/clang
      benefit a little bit as well, since they can skip some intermediate
      `std::type_info*` arrays.
      56613945
  3. 14 Sep, 2017 1 commit
  4. 13 Sep, 2017 2 commits
  5. 12 Sep, 2017 2 commits
    • Dean Moldovan's avatar
      Make TypeErrors more informative when an optional header is missing · 2b4477eb
      Dean Moldovan authored
      E.g. trying to convert a `list` to a `std::vector<int>` without
      including <pybind11/stl.h> will now raise an error with a note that
      suggests checking the headers.
      
      The note is only appended if `std::` is found in the function
      signature. This should only be the case when a header is missing.
      E.g. when stl.h is included, the signature would contain `List[int]`
      instead of `std::vector<int>` while using stl_bind.h would produce
      something like `MyVector`. Similarly for `std::map`/`Dict`, `complex`,
      `std::function`/`Callable`, etc.
      
      There's a possibility for false positives, but it's pretty low.
      2b4477eb
    • Gunnar Läthén's avatar
      c64e6b16
  6. 10 Sep, 2017 3 commits
  7. 08 Sep, 2017 1 commit
  8. 07 Sep, 2017 1 commit
  9. 06 Sep, 2017 2 commits
  10. 04 Sep, 2017 2 commits
  11. 01 Sep, 2017 1 commit
  12. 31 Aug, 2017 4 commits
  13. 30 Aug, 2017 5 commits
  14. 28 Aug, 2017 3 commits
  15. 25 Aug, 2017 2 commits
  16. 23 Aug, 2017 2 commits
  17. 22 Aug, 2017 3 commits
  18. 20 Aug, 2017 2 commits
  19. 19 Aug, 2017 2 commits
    • Patrik Huber's avatar
      Fix typos in Eigen documentation · d265933d
      Patrik Huber authored
      Fixes one small variable name typo, and two instances where `py::arg().nocopy()` is used, where I think it should be `py::arg().noconvert()` instead. Probably `nocopy()` was the old/original name for it and then it was changed.
      d265933d
    • Jason Rhinelander's avatar
      Allow module-local classes to be loaded externally · 5e14aa6a
      Jason Rhinelander authored
      The main point of `py::module_local` is to make the C++ -> Python cast
      unique so that returning/casting a C++ instance is well-defined.
      Unfortunately it also makes loading unique, but this isn't particularly
      desirable: when an instance contains `Type` instance there's no reason
      it shouldn't be possible to pass that instance to a bound function
      taking a `Type` parameter, even if that function is in another module.
      
      This commit solves the issue by allowing foreign module (and global)
      type loaders have a chance to load the value if the local module loader
      fails.  The implementation here does this by storing a module-local
      loading function in a capsule in the python type, which we can then call
      if the local (and possibly global, if the local type is masking a global
      type) version doesn't work.
      5e14aa6a