From ad904b6cd3906ddf79878003d92b7bc08d7786ae Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 19 Dec 2019 12:03:35 -0800 Subject: Export of internal Abseil changes -- 24162e64040e89f174531fa78fc0ff43c3a67da4 by Abseil Team : Make ABSL_RETIRED_FLAG behave consistently with ABSL_FLAG. Before the change: ABSL_RETIRED_FLAG does not compile when there are competing ctors in the type, even when ABSL_FLAG does. After the change: ABSL_RETIRED_FLAG compiles when ABSL_FLAG does. PiperOrigin-RevId: 286437395 -- 870d4cb4d114813e9cefe30d26d020b0fdcdc4b4 by Tom Manshreck : Add docs on bind_front PiperOrigin-RevId: 286433540 -- b0c328bd9bb64e0382f942f93b85054229dafeac by Tom Manshreck : Specify the format for LogSeverity flags PiperOrigin-RevId: 286402811 GitOrigin-RevId: 24162e64040e89f174531fa78fc0ff43c3a67da4 Change-Id: I89785145d049fee49c6b9cf3357893ece9a6231c --- absl/flags/internal/flag.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'absl/flags/internal/flag.h') diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h index 20de406..21a10c7 100644 --- a/absl/flags/internal/flag.h +++ b/absl/flags/internal/flag.h @@ -416,6 +416,20 @@ T* MakeFromDefaultValue(EmptyBraces) { return new T; } +// MakeFromDefaultValueOrEmpty is basically the same as MakeFromDefaultValue. It +// also allows for empty macro parameter (hence no argument), which was somehow +// widely used for ABSL_RETIRED_FLAG(). + +template +T* MakeFromDefaultValueOrEmpty(T t) { + return MakeFromDefaultValue(std::move(t)); +} + +template +T* MakeFromDefaultValueOrEmpty() { + return MakeFromDefaultValue(EmptyBraces()); +} + } // namespace flags_internal ABSL_NAMESPACE_END } // namespace absl -- cgit v1.2.3