diff options
Diffstat (limited to 'src/core/lib/gprpp/debug_location.h')
-rw-r--r-- | src/core/lib/gprpp/debug_location.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/lib/gprpp/debug_location.h b/src/core/lib/gprpp/debug_location.h index 1a29f49538..c6c9b68286 100644 --- a/src/core/lib/gprpp/debug_location.h +++ b/src/core/lib/gprpp/debug_location.h @@ -19,6 +19,10 @@ #ifndef GRPC_SRC_CORE_LIB_GPRPP_DEBUG_LOCATION_H #define GRPC_SRC_CORE_LIB_GPRPP_DEBUG_LOCATION_H +#include <grpc/support/port_platform.h> + +#include <utility> + #if defined(__has_builtin) #if __has_builtin(__builtin_FILE) #define GRPC_DEFAULT_FILE __builtin_FILE() @@ -77,6 +81,15 @@ class DebugLocation { }; #endif +template <typename T> +struct ValueWithDebugLocation { + // NOLINTNEXTLINE + ValueWithDebugLocation(T&& value, DebugLocation debug_location = {}) + : value(std::forward<T>(value)), debug_location(debug_location) {} + T value; + GPR_NO_UNIQUE_ADDRESS DebugLocation debug_location; +}; + #define DEBUG_LOCATION ::grpc_core::DebugLocation(__FILE__, __LINE__) } // namespace grpc_core |