Use this-> when referencing members of template base-class. · ModernCppNexus/cppcoro@a270518 · GitHub
Skip to content

Commit a270518

Browse files
committed
Use this-> when referencing members of template base-class.
Fixes some compilation errors under Clang.
1 parent 5ea2225 commit a270518

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

include/cppcoro/lazy_task.hpp

Lines changed: 4 additions & 4 deletions

include/cppcoro/shared_lazy_task.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace cppcoro
223223

224224
~shared_lazy_task_promise()
225225
{
226-
if (is_ready() && !completed_with_unhandled_exception())
226+
if (this->is_ready() && !this->completed_with_unhandled_exception())
227227
{
228228
reinterpret_cast<T*>(&m_valueStorage)->~T();
229229
}
@@ -245,7 +245,7 @@ namespace cppcoro
245245

246246
T& result()
247247
{
248-
rethrow_if_unhandled_exception();
248+
this->rethrow_if_unhandled_exception();
249249
return *reinterpret_cast<T*>(&m_valueStorage);
250250
}
251251

@@ -275,7 +275,7 @@ namespace cppcoro
275275

276276
void result()
277277
{
278-
rethrow_if_unhandled_exception();
278+
this->rethrow_if_unhandled_exception();
279279
}
280280

281281
};
@@ -299,7 +299,7 @@ namespace cppcoro
299299

300300
T& result()
301301
{
302-
rethrow_if_unhandled_exception();
302+
this->rethrow_if_unhandled_exception();
303303
return *m_value;
304304
}
305305

@@ -426,12 +426,12 @@ namespace cppcoro
426426

427427
decltype(auto) await_resume()
428428
{
429-
if (!m_coroutine)
429+
if (!this->m_coroutine)
430430
{
431431
throw broken_promise{};
432432
}
433433

434-
return m_coroutine.promise().result();
434+
return this->m_coroutine.promise().result();
435435
}
436436
};
437437

include/cppcoro/shared_task.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace cppcoro
184184

185185
~shared_task_promise()
186186
{
187-
if (!completed_with_unhandled_exception())
187+
if (!this->completed_with_unhandled_exception())
188188
{
189189
reinterpret_cast<T*>(&m_valueStorage)->~T();
190190
}
@@ -206,7 +206,7 @@ namespace cppcoro
206206

207207
T& result()
208208
{
209-
rethrow_if_unhandled_exception();
209+
this->rethrow_if_unhandled_exception();
210210
return *reinterpret_cast<T*>(&m_valueStorage);
211211
}
212212

@@ -236,7 +236,7 @@ namespace cppcoro
236236

237237
void result()
238238
{
239-
rethrow_if_unhandled_exception();
239+
this->rethrow_if_unhandled_exception();
240240
}
241241

242242
};
@@ -260,7 +260,7 @@ namespace cppcoro
260260

261261
T& result()
262262
{
263-
rethrow_if_unhandled_exception();
263+
this->rethrow_if_unhandled_exception();
264264
return *m_value;
265265
}
266266

@@ -387,12 +387,12 @@ namespace cppcoro
387387

388388
decltype(auto) await_resume()
389389
{
390-
if (!m_coroutine)
390+
if (!this->m_coroutine)
391391
{
392392
throw broken_promise{};
393393
}
394394

395-
return m_coroutine.promise().result();
395+
return this->m_coroutine.promise().result();
396396
}
397397
};
398398

include/cppcoro/task.hpp

Lines changed: 4 additions & 4 deletions

0 commit comments

Comments
 (0)