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.
# 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
/// 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
// 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");
// 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
@ -72,8 +72,10 @@ inspection/testing in python) by using the functions with `print_` replaced with
@@ -72,8 +72,10 @@ inspection/testing in python) by using the functions with `print_` replaced with
classConstructorStats{
protected:
std::unordered_map<void*,int>_instances;// Need a map rather than set because members can shared address with parents
std::list<std::string>_values;// Used to track values (e.g. of value constructors)
std::unordered_map<void*,int>_instances;// Need a map rather than set because members can
// shared address with parents
std::list<std::string>_values;// Used to track values