@@ -231,22 +231,22 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
231231
232232 // The pointers to call/move/destroy functions are determined for each
233233 // callable type (and called-as type, which determines the overload chosen).
234- // (definitions are out-of-line).
235234
236235 // By default, we need an object that contains all the different
237236 // type erased behaviors needed. Create a static instance of the struct type
238237 // here and each instance will contain a pointer to it.
239238 // Wrap in a struct to avoid https://gcc.gnu.org/PR71954
240239 template <typename CallableT, typename CalledAs, typename Enable = void >
241240 struct CallbacksHolder {
242- static NonTrivialCallbacks Callbacks;
241+ inline static NonTrivialCallbacks Callbacks = {
242+ &CallImpl<CalledAs>, &MoveImpl<CallableT>, &DestroyImpl<CallableT>};
243243 };
244244 // See if we can create a trivial callback. We need the callable to be
245245 // trivially moved and trivially destroyed so that we don't have to store
246246 // type erased callbacks for those operations.
247247 template <typename CallableT, typename CalledAs>
248248 struct CallbacksHolder <CallableT, CalledAs, EnableIfTrivial<CallableT>> {
249- static TrivialCallback Callbacks;
249+ inline static TrivialCallback Callbacks = {&CallImpl<CalledAs>} ;
250250 };
251251
252252 // A simple tag type so the call-as type to be passed to the constructor.
@@ -344,19 +344,6 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
344344 }
345345};
346346
347- template <typename R, typename ... P>
348- template <typename CallableT, typename CalledAsT, typename Enable>
349- typename UniqueFunctionBase<R, P...>::NonTrivialCallbacks UniqueFunctionBase<
350- R, P...>::CallbacksHolder<CallableT, CalledAsT, Enable>::Callbacks = {
351- &CallImpl<CalledAsT>, &MoveImpl<CallableT>, &DestroyImpl<CallableT>};
352-
353- template <typename R, typename ... P>
354- template <typename CallableT, typename CalledAsT>
355- typename UniqueFunctionBase<R, P...>::TrivialCallback
356- UniqueFunctionBase<R, P...>::CallbacksHolder<
357- CallableT, CalledAsT, EnableIfTrivial<CallableT>>::Callbacks{
358- &CallImpl<CalledAsT>};
359-
360347} // namespace detail
361348
362349template <typename R, typename ... P>
0 commit comments