Fixes to support building in -std=c++20 mode.

* Structs with user-declared constructors are no longer considered
  aggregates, so remove the declarations when possible
* Types of both arguments to "==" must match to avoid "ambiguous
  function call" warning
* Various types of math involving enums are deprecated, so replace with
  constexprs where necessary
* ABSL_CONST_INIT must be used on definition as well as declaration
* volatile memory may no longer be read from and written to by the same
  operator, so replace e.g. "n++" with "n = n + 1"
* Replace an outdated check for no_unique_address support with
  __has_cpp_attribute
* std::result_of(f(x)) has been removed, replace with
  std::invoke_result(f, x)

Bug: chromium:1284275
Change-Id: I77b366ab1da7eb2c1e4c825b2714417c31ee5903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261221
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36786}
diff --git a/rtc_base/task_utils/repeating_task.h b/rtc_base/task_utils/repeating_task.h
index 20f28d5..1086c16 100644
--- a/rtc_base/task_utils/repeating_task.h
+++ b/rtc_base/task_utils/repeating_task.h
@@ -75,8 +75,8 @@
         closure_(std::forward<Closure>(closure)) {
     static_assert(
         std::is_same<TimeDelta,
-                     typename std::result_of<decltype (&Closure::operator())(
-                         Closure)>::type>::value,
+                     typename std::invoke_result<decltype(&Closure::operator()),
+                                                 Closure>::type>::value,
         "");
   }