質問編集履歴

4

修正

2022/09/27 14:43

投稿

4567sky
4567sky

score82

test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,7 @@
8
8
  struct Test
9
9
  {
10
10
  std::string name;
11
- Test( const std::string&& _name )
11
+ Test( std::string&& _name )
12
12
  : name( std::forward<std::string>( _name ) ) // ③−2
13
13
  {
14
14
  }

3

追記

2022/09/27 14:35

投稿

4567sky
4567sky

score82

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

文法修正

2022/09/27 14:34

投稿

4567sky
4567sky

score82

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

ごじ

2022/09/27 14:32

投稿

4567sky
4567sky

score82

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::foword<std::string>( _name ) // ③−2
12
+ : std::forward<std::string>( _name ) // ③−2
13
13
  {
14
14
  }
15
15
  }