1. Oct 28, 2016
  2. Oct 25, 2016
  3. Oct 23, 2016
  4. Oct 22, 2016
  5. Oct 21, 2016
    • Ben North's avatar
      Test uncopyable static member · bbe45082
      Ben North authored
      Without the previous commit, this test generates a core dump.
      bbe45082
    • Ben North's avatar
      Fix wrapper's 'value' and 'owned' if ctor missing · 24a2054d
      Ben North authored
      type_caster_generic::cast(): The values of
      
          wrapper->value
          wrapper->owned
      
      are incorrect in the case that a return value policy of 'copy' is
      requested but there is no copy-constructor.  (Similarly 'move'.)  In
      particular, if the source object is a static instance, the destructor of
      the 'object' 'inst' leads to class_::dealloc() which incorrectly
      attempts to 'delete' the static instance.
      
      This commit re-arranges the code to be clearer as to what the values of
      'value' and 'owned' should be in the various cases.  Behaviour is
      different to previous code only in two situations:
      
      policy = copy but no copy-ctor: Old code leaves 'value = src, owned =
      true', which leads to trouble.  New code leaves 'value = nullptr, owned
      = false', which is correct.
      
      policy = move but no move- or copy-ctor: old code leaves 'value = src,
      owned = true', which leads to trouble.  New code leaves 'value =
      nullptr, owned = false', which is correct.
      24a2054d
    • Wenzel Jakob's avatar
      Merge pull request #454 from dean0x7d/shared_ptr · 77898af0
      Wenzel Jakob authored
      Support std::shared_ptr holder type out of the box
      77898af0
  6. Oct 20, 2016
  7. Oct 17, 2016
    • Wenzel Jakob's avatar
      Merge pull request #450 from dean0x7d/explicit-bool · 35995856
      Wenzel Jakob authored
      Make operator bool() explicit
      35995856
    • Dean Moldovan's avatar
      Make operator bool() explicit · c889ebd0
      Dean Moldovan authored
      This prevents unwanted conversions to bool or int such as:
      ```
      py::object my_object;
      
      std::cout << my_object << std::endl; // compiles and prints 0 or 1
      int n = my_object; // compiles and is nonsense
      ```
      
      With `explicit operator bool()` the above cases become compiler errors.
      c889ebd0
    • Wenzel Jakob's avatar
      Merge pull request #449 from jagerman/no-implicit-conversions · 135fd149
      Wenzel Jakob authored
      Disable most implicit conversion constructors
      135fd149
    • Jason Rhinelander's avatar
      Disable most implicit conversion constructors · 12d76600
      Jason Rhinelander authored
      We have various classes that have non-explicit constructors that accept
      a single argument, which is implicitly making them implicitly
      convertible from the argument.  In a few cases, this is desirable (e.g.
      implicit conversion of std::string to py::str, or conversion of double
      to py::float_); in many others, however, it is unintended (e.g. implicit
      conversion of size_t to some pre-declared py::array_t<T> type).
      
      This disables most of the unwanted implicit conversions by marking them
      `explicit`, and comments the ones that are deliberately left implicit.
      12d76600
  8. Oct 16, 2016
  9. Oct 15, 2016