Final manual curation in preparation for global `clang-format`ing (#3712)
* Manual line breaks to pre-empt undesired `clang-format`ing.
Informed by work under https://github.com/pybind/pybind11/pull/3683:
60b7eb410f59572e6559
* Manual curation of clang-format diffs involving source code comments.
Very labor-intensive and dull.
* Pulling .clang-format change from @henryiii's 9057962d40
* Adding commonly used .clang-format `CommentPragmas:`
* Ensure short lambdas are allowed
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
pull/3718/head
Ralf W. Grosse-Kunstleve3 years agocommitted byGitHub
# 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.
# pragma warning(disable: 4275)
// warning C4275: An exported class was derived from a class that wasn't exported.
// TODO PYBIND11_DEPRECATED("Call py::type::handle_of(h) or py::type::of(h) instead of h.get_type()")
// TODO PYBIND11_DEPRECATED(
// "Call py::type::handle_of(h) or py::type::of(h) instead of h.get_type()")
handleget_type()const;
handleget_type()const;
private:
private:
@ -337,7 +338,9 @@ PYBIND11_NAMESPACE_END(detail)
#if defined(_MSC_VER)
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(push)
# pragma warning(disable: 4275 4251) // warning C4275: An exported class was derived from a class that wasn't exported. Can be ignored when derived from a STL class.
# pragma warning(disable: 4275 4251)
// warning C4275: An exported class was derived from a class that wasn't exported.
// Can be ignored when derived from a STL class.
#endif
#endif
/// Fetch and hold an error which was already set in Python. An instance of this is typically
/// Fetch and hold an error which was already set in Python. An instance of this is typically
/// thrown to propagate python-side errors back through C++ which can either be caught manually or
/// thrown to propagate python-side errors back through C++ which can either be caught manually or
// Provide the buffer interface for vectors if we have data() and we have a format for it
// Provide the buffer interface for vectors if we have data() and we have a format for it
// GCC seems to have "void std::vector<bool>::data()" - doing SFINAE on the existence of data() is insufficient, we need to check it returns an appropriate pointer
// GCC seems to have "void std::vector<bool>::data()" - doing SFINAE on the existence of data()
// is insufficient, we need to check it returns an appropriate pointer
static_assert(vector_has_data_and_format<Vector>::value,"There is not an appropriate format descriptor for this vector");
static_assert(vector_has_data_and_format<Vector>::value,"There is not an appropriate format descriptor for this vector");
// numpy.h declares this for arbitrary types, but it may raise an exception and crash hard at runtime if PYBIND11_NUMPY_DTYPE hasn't been called, so check here
// numpy.h declares this for arbitrary types, but it may raise an exception and crash hard
// at runtime if PYBIND11_NUMPY_DTYPE hasn't been called, so check here