質問編集履歴

1

追加情報

2019/11/02 16:28

投稿

asobinin
asobinin

スコア69

test CHANGED
File without changes
test CHANGED
@@ -6,6 +6,26 @@
6
6
 
7
7
 
8
8
 
9
+ 実行環境:
10
+
11
+ OS Windows10 home
12
+
13
+ コンパイラ:
14
+
15
+ Visual Studio2019
16
+
17
+ エラー文 C2280 'asobi::detail::property_options<T,asobi::options::get,asobi::options::set>::property_options(void)': 削除された関数を参照しようとしています
18
+
19
+
20
+
21
+ GCC 8.2.0
22
+
23
+ エラー文(一部抜粋) In function 'int main()':
24
+
25
+ test.cpp:16:52: error: use of deleted function 'asobi::property<int, asobi::options::get, asobi::options::set>::property(int&) [inherited from asobi::detail::none_options_property<int>]'
26
+
27
+ asobi::property<int, GET_OP, SET_OP> value(m_value);
28
+
9
29
  ___
10
30
 
11
31
  コードが長くなってしまいますが、すべてのコントラスタはproperty_detail.hppの中の基底クラスであるnone_options_propertyのコントラスタを継承しています。
@@ -178,14 +198,14 @@
178
198
 
179
199
  public: // functions
180
200
 
201
+ inline auto& set(T&& value) { this->m_ref_value = std::move(value); return *this; }
202
+
181
203
  inline auto& set(const T& value) { this->m_ref_value = value; return *this; }
182
204
 
183
- inline auto& set(T&& value) { this->m_ref_value = std::move(value); return *this; }
205
+ inline auto& operator =(T&& value) { this->m_ref_value = std::move(value); return *this; }
184
206
 
185
207
  inline auto& operator =(const T& value) { this->m_ref_value = value; return *this; }
186
208
 
187
- inline auto& operator =(T&& value) { this->m_ref_value = std::move(value); return *this; }
188
-
189
209
  inline auto& operator +=(T&& value) { this->m_ref_value += value; return *this; }
190
210
 
191
211
  inline auto& operator +=(const T& value) { this->m_ref_value += value; return *this; }