Skip to content

Commit 289f0d9

Browse files
[axlstar] Utilise 'std::forward()' au lieu de 'std::move()' pour les rvalues.
1 parent 4bfbdf6 commit 289f0d9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

axlstar/Arcane.Axl.T4/Arcane.Axl/T4.StrongOptions/StrongOptions_h.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version:6.0.28
4+
// Runtime Version:6.0.32
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -178,7 +178,7 @@ public virtual string TransformText() {
178178
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.ToFuncName() ));
179179
this.Write("_, Args...>(m_");
180180
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.DashToUnderscore() ));
181-
this.Write(", std::move(args)...);\n");
181+
this.Write(", std::forward<Args>(args)...);\n");
182182
}
183183
else {
184184
if(problemStdArray) {
@@ -188,7 +188,8 @@ public virtual string TransformText() {
188188
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.ToFuncName() ));
189189
this.Write("_, Args...>(m_");
190190
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.DashToUnderscore() ));
191-
this.Write(", std::move(args)...);\n // todo replace by static assert\t\n if(!exist_");
191+
this.Write(", std::forward<Args>(args)...);\n // todo replace by static assert\t\n if(!exi" +
192+
"st_");
192193
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.DashToUnderscore() ));
193194
this.Write(")\n throw ");
194195
this.Write(this.ToStringHelper.ToStringWithCulture(SimpleTypeExtensions.Namespace()));
@@ -201,7 +202,7 @@ public virtual string TransformText() {
201202
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.DashToUnderscore() ));
202203
this.Write(" = OptionTools::requiredFixedArray<");
203204
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.ToFuncName() ));
204-
this.Write("_, 1, Args...>(std::move(args)...)[0];\n");
205+
this.Write("_, 1, Args...>(std::forward<Args>(args)...)[0];\n");
205206
}
206207
}
207208
}
@@ -215,7 +216,7 @@ public virtual string TransformText() {
215216
this.Write(this.ToStringHelper.ToStringWithCulture( _option.Name.ToFuncName() ));
216217
this.Write("_, ");
217218
this.Write(this.ToStringHelper.ToStringWithCulture( _option.MinOccurs ));
218-
this.Write(", -1, Args...>(std::move(args)...);\n");
219+
this.Write(", -1, Args...>(std::forward<Args>(args)...);\n");
219220
}
220221
this.Write("\n");
221222
};

axlstar/Arcane.Axl.T4/Arcane.Axl/T4.StrongOptions/StrongOptions_h.tt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@
4949
<# if (_option.IsSingle == true) { #>
5050
<# if (hasDefault) { #>
5151
m_<#= _option.Name.DashToUnderscore() #> = <#= _option_default #>;
52-
OptionTools::optionalSimple<<#= _option.Name.ToFuncName() #>_, Args...>(m_<#= _option.Name.DashToUnderscore() #>, std::move(args)...);
52+
OptionTools::optionalSimple<<#= _option.Name.ToFuncName() #>_, Args...>(m_<#= _option.Name.DashToUnderscore() #>, std::forward<Args>(args)...);
5353
<# }
5454
else {
5555
if(problemStdArray) { #>
56-
static bool exist_<#= _option.Name.DashToUnderscore() #> = OptionTools::optionalSimple<<#= _option.Name.ToFuncName() #>_, Args...>(m_<#= _option.Name.DashToUnderscore() #>, std::move(args)...);
56+
static bool exist_<#= _option.Name.DashToUnderscore() #> = OptionTools::optionalSimple<<#= _option.Name.ToFuncName() #>_, Args...>(m_<#= _option.Name.DashToUnderscore() #>, std::forward<Args>(args)...);
5757
// todo replace by static assert
5858
if(!exist_<#= _option.Name.DashToUnderscore() #>)
5959
throw <#=SimpleTypeExtensions.Namespace()#>::FatalErrorException(A_FUNCINFO, "missing required option <#= _option.Name.ToFuncName() #>");
6060
<# }
6161
else { #>
62-
m_<#= _option.Name.DashToUnderscore() #> = OptionTools::requiredFixedArray<<#= _option.Name.ToFuncName() #>_, 1, Args...>(std::move(args)...)[0];
62+
m_<#= _option.Name.DashToUnderscore() #> = OptionTools::requiredFixedArray<<#= _option.Name.ToFuncName() #>_, 1, Args...>(std::forward<Args>(args)...)[0];
6363
<# }
6464
}
6565
} #>
6666
<# else { #>
6767
<# if (hasDefault) { #>
6868
//#warning "Default for multi options not used"
6969
<# } #>
70-
m_<#= _option.Name.DashToUnderscore() #> = OptionTools::requiredVariableArray<<#= _option.Name.ToFuncName() #>_, <#= _option.MinOccurs #>, -1, Args...>(std::move(args)...);
70+
m_<#= _option.Name.DashToUnderscore() #> = OptionTools::requiredVariableArray<<#= _option.Name.ToFuncName() #>_, <#= _option.MinOccurs #>, -1, Args...>(std::forward<Args>(args)...);
7171
<# } #>
7272

7373
<# }; #>

0 commit comments

Comments
 (0)