From bd0dbd7cf5142c27e79a1410311d042b700af86e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 11 Jul 2022 10:22:05 -0700 Subject: [PATCH] src_loc comments --- include/pybind11/detail/descr.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/pybind11/detail/descr.h b/include/pybind11/detail/descr.h index eb0b2b501..7bcda4ce2 100644 --- a/include/pybind11/detail/descr.h +++ b/include/pybind11/detail/descr.h @@ -31,6 +31,11 @@ PYBIND11_NAMESPACE_BEGIN(detail) #ifdef PYBIND11_DETAIL_DESCR_SRC_LOC_ON +// Not using std::source_location because +// (https://en.cppreference.com/w/cpp/utility/source_location): +// 1. It is unspecified whether the copy/move constructors and the copy/move +// assignment operators of source_location are trivial and/or constexpr. +// 2. A no-op stub is needed (below). struct src_loc { const char *file; unsigned line; @@ -52,6 +57,8 @@ struct src_loc { #else +// No-op stub, for compilers that do not support __builtin_FILE(), __builtin_LINE(), +// or for situations in which it is desirable to disable the src_loc feature. struct src_loc { constexpr src_loc(const char *, unsigned) {}