• 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
common.h 21.5 KB