|
42 | 42 | # endif
|
43 | 43 | # endif
|
44 | 44 | #elif defined(_MSC_VER) && __cplusplus == 199711L
|
45 |
| -// MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully implemented) |
46 |
| -// Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 or newer |
| 45 | +// MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully |
| 46 | +// implemented). Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 |
| 47 | +// or newer. |
47 | 48 | # if _MSVC_LANG >= 201402L
|
48 | 49 | # define PYBIND11_CPP14
|
49 | 50 | # if _MSVC_LANG > 201402L && _MSC_VER >= 1910
|
@@ -722,8 +723,8 @@ template <typename T, typename... Ts>
|
722 | 723 | constexpr int last(int i, int result, T v, Ts... vs) { return last(i + 1, v ? i : result, vs...); }
|
723 | 724 | PYBIND11_NAMESPACE_END(constexpr_impl)
|
724 | 725 |
|
725 |
| -/// Return the index of the first type in Ts which satisfies Predicate<T>. Returns sizeof...(Ts) if |
726 |
| -/// none match. |
| 726 | +/// Return the index of the first type in Ts which satisfies Predicate<T>. |
| 727 | +/// Returns sizeof...(Ts) if none match. |
727 | 728 | template <template<typename> class Predicate, typename... Ts>
|
728 | 729 | constexpr int constexpr_first() { return constexpr_impl::first(0, Predicate<Ts>::value...); }
|
729 | 730 |
|
@@ -842,7 +843,9 @@ PYBIND11_NAMESPACE_END(detail)
|
842 | 843 |
|
843 | 844 | #if defined(_MSC_VER)
|
844 | 845 | # pragma warning(push)
|
845 |
| -# pragma warning(disable: 4275) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class. |
| 846 | +# pragma warning(disable: 4275) |
| 847 | +// warning C4275: An exported class was derived from a class that wasn't exported. |
| 848 | +// Can be ignored when derived from a STL class. |
846 | 849 | #endif
|
847 | 850 | /// C++ bindings of builtin Python exceptions
|
848 | 851 | class PYBIND11_EXPORT_EXCEPTION builtin_exception : public std::runtime_error {
|
@@ -870,7 +873,9 @@ PYBIND11_RUNTIME_EXCEPTION(type_error, PyExc_TypeError)
|
870 | 873 | PYBIND11_RUNTIME_EXCEPTION(buffer_error, PyExc_BufferError)
|
871 | 874 | PYBIND11_RUNTIME_EXCEPTION(import_error, PyExc_ImportError)
|
872 | 875 | PYBIND11_RUNTIME_EXCEPTION(attribute_error, PyExc_AttributeError)
|
873 |
| -PYBIND11_RUNTIME_EXCEPTION(cast_error, PyExc_RuntimeError) /// Thrown when pybind11::cast or handle::call fail due to a type casting error |
| 876 | +PYBIND11_RUNTIME_EXCEPTION(cast_error, PyExc_RuntimeError) /// Thrown when pybind11::cast or |
| 877 | + /// handle::call fail due to a type |
| 878 | + /// casting error |
874 | 879 | PYBIND11_RUNTIME_EXCEPTION(reference_cast_error, PyExc_RuntimeError) /// Used internally
|
875 | 880 |
|
876 | 881 | [[noreturn]] PYBIND11_NOINLINE void pybind11_fail(const char *reason) { throw std::runtime_error(reason); }
|
@@ -974,13 +979,14 @@ class any_container {
|
974 | 979 | template <typename It, typename = enable_if_t<is_input_iterator<It>::value>>
|
975 | 980 | any_container(It first, It last) : v(first, last) { }
|
976 | 981 |
|
977 |
| - // Implicit conversion constructor from any arbitrary container type with values convertible to T |
| 982 | + // Implicit conversion constructor from any arbitrary container type |
| 983 | + // with values convertible to T |
978 | 984 | template <typename Container, typename = enable_if_t<std::is_convertible<decltype(*std::begin(std::declval<const Container &>())), T>::value>>
|
979 | 985 | // NOLINTNEXTLINE(google-explicit-constructor)
|
980 | 986 | any_container(const Container &c) : any_container(std::begin(c), std::end(c)) { }
|
981 | 987 |
|
982 |
| - // initializer_list's aren't deducible, so don't get matched by the above template; we need this |
983 |
| - // to explicitly allow implicit conversion from one: |
| 988 | + // initializer_list's aren't deducible, so don't get matched by the above template; |
| 989 | + // we need this to explicitly allow implicit conversion from one: |
984 | 990 | template <typename TIn, typename = enable_if_t<std::is_convertible<TIn, T>::value>>
|
985 | 991 | any_container(const std::initializer_list<TIn> &c) : any_container(c.begin(), c.end()) { }
|
986 | 992 |
|
|
0 commit comments