質問編集履歴
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
struct Test
|
9
9
|
{
|
10
10
|
std::string name;
|
11
|
-
Test(
|
11
|
+
Test( std::string&& _name )
|
12
12
|
: name( std::forward<std::string>( _name ) ) // ③−2
|
13
13
|
{
|
14
14
|
}
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
struct Test
|
9
9
|
{
|
10
10
|
std::string name;
|
11
|
-
Test( std::string&& _name )
|
11
|
+
Test( const std::string&& _name )
|
12
12
|
: name( std::forward<std::string>( _name ) ) // ③−2
|
13
13
|
{
|
14
14
|
}
|
2
文法修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
{
|
10
10
|
std::string name;
|
11
11
|
Test( std::string&& _name )
|
12
|
-
: std::forward<std::string>( _name ) // ③−2
|
12
|
+
: name( std::forward<std::string>( _name ) ) // ③−2
|
13
13
|
{
|
14
14
|
}
|
15
15
|
}
|
1
ごじ
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
{
|
10
10
|
std::string name;
|
11
11
|
Test( std::string&& _name )
|
12
|
-
: std::fow
|
12
|
+
: std::forward<std::string>( _name ) // ③−2
|
13
13
|
{
|
14
14
|
}
|
15
15
|
}
|