diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index d3f553caac8f9f..bb637d3a77f6fa 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -5,6 +5,7 @@ #include #include +#include "util-inl.h" namespace node { namespace inspector { diff --git a/src/util-inl.h b/src/util-inl.h index e945c614d49e81..0edf77496e9eba 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -160,8 +160,8 @@ ContainerOfHelper::operator TypeName*() const { } template -inline ContainerOfHelper ContainerOf(Inner Outer::*field, - Inner* pointer) { +constexpr ContainerOfHelper ContainerOf(Inner Outer::*field, + Inner* pointer) { return ContainerOfHelper(field, pointer); } diff --git a/src/util.h b/src/util.h index 880408df4d57fd..68b8fe144bb623 100644 --- a/src/util.h +++ b/src/util.h @@ -198,8 +198,8 @@ class ContainerOfHelper { // Calculate the address of the outer (i.e. embedding) struct from // the interior pointer to a data member. template -inline ContainerOfHelper ContainerOf(Inner Outer::*field, - Inner* pointer); +constexpr ContainerOfHelper ContainerOf(Inner Outer::*field, + Inner* pointer); // If persistent.IsWeak() == false, then do not call persistent.Reset() // while the returned Local is still in scope, it will destroy the