[Bf-blender-cvs] [c8a18fd239a] master: Cleanup: add hint that typedef is used as compiler bug workaround

Jacques Lucke noreply at git.blender.org
Tue Sep 20 10:43:17 CEST 2022


Commit: c8a18fd239a65ac75ad06af9f59c70559a87f405
Author: Jacques Lucke
Date:   Tue Sep 20 10:42:25 2022 +0200
Branches: master
https://developer.blender.org/rBc8a18fd239a65ac75ad06af9f59c70559a87f405

Cleanup: add hint that typedef is used as compiler bug workaround

https://developercommunity.visualstudio.com/t/Alias-template-inside-fold-expression-fa/10040507

===================================================================

M	source/blender/functions/FN_lazy_function_execute.hh
M	source/blender/functions/FN_multi_function_builder.hh

===================================================================

diff --git a/source/blender/functions/FN_lazy_function_execute.hh b/source/blender/functions/FN_lazy_function_execute.hh
index 5a80985cdc0..ade23ad17c7 100644
--- a/source/blender/functions/FN_lazy_function_execute.hh
+++ b/source/blender/functions/FN_lazy_function_execute.hh
@@ -67,6 +67,7 @@ inline void execute_lazy_function_eagerly_impl(
   (
       [&]() {
         constexpr size_t I = InIndices;
+        /* Use `typedef` instead of `using` to work around a compiler bug. */
         typedef Inputs T;
         const CPPType &type = CPPType::get<T>();
         input_pointers[I] = {type, &std::get<I>(inputs)};
@@ -75,6 +76,7 @@ inline void execute_lazy_function_eagerly_impl(
   (
       [&]() {
         constexpr size_t I = OutIndices;
+        /* Use `typedef` instead of `using` to work around a compiler bug. */
         typedef Outputs T;
         const CPPType &type = CPPType::get<T>();
         output_pointers[I] = {type, std::get<I>(outputs)};
diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh
index e6dc01eb539..75a2414801d 100644
--- a/source/blender/functions/FN_multi_function_builder.hh
+++ b/source/blender/functions/FN_multi_function_builder.hh
@@ -207,6 +207,7 @@ void execute_materialized(TypeSequence<ParamTags...> /* param_tags */,
   (
       /* Setup information for all parameters. */
       [&] {
+        /* Use `typedef` instead of `using` to work around a compiler bug. */
         typedef ParamTags ParamTag;
         typedef typename ParamTag::base_type T;
         [[maybe_unused]] ArgInfo<ParamTags> &arg_info = std::get<I>(args_info);
@@ -282,6 +283,7 @@ void execute_materialized(TypeSequence<ParamTags...> /* param_tags */,
     (
         /* Destruct values that have been materialized before. */
         [&] {
+          /* Use `typedef` instead of `using` to work around a compiler bug. */
           typedef ParamTags ParamTag;
           typedef typename ParamTag::base_type T;
           [[maybe_unused]] ArgInfo<ParamTags> &arg_info = std::get<I>(args_info);
@@ -298,6 +300,7 @@ void execute_materialized(TypeSequence<ParamTags...> /* param_tags */,
   (
       /* Destruct buffers for single value inputs. */
       [&] {
+        /* Use `typedef` instead of `using` to work around a compiler bug. */
         typedef ParamTags ParamTag;
         typedef typename ParamTag::base_type T;
         [[maybe_unused]] ArgInfo<ParamTags> &arg_info = std::get<I>(args_info);
@@ -347,6 +350,7 @@ template<typename... ParamTags> class CustomMF : public MultiFunction {
     (
         /* Get all parameters from #params and store them in #retrieved_params. */
         [&]() {
+          /* Use `typedef` instead of `using` to work around a compiler bug. */
           typedef typename TagsSequence::template at_index<I> ParamTag;
           typedef typename ParamTag::base_type T;
 
@@ -402,6 +406,7 @@ template<typename... ParamTags> class CustomMF : public MultiFunction {
     (
         /* Loop over all parameter types and add an entry for each in the signature. */
         [&] {
+          /* Use `typedef` instead of `using` to work around a compiler bug. */
           typedef typename TagsSequence::template at_index<I> ParamTag;
           signature.add(ParamTag(), "");
         }(),



More information about the Bf-blender-cvs mailing list