Skip to content

Commit 5a974f7

Browse files
authored
[util.smartptr.atomic.general] Simplify example code (#6077)
Removes the redundant explicit construction of the return value, and uses an explicit return type instead of "auto" for clarity.
1 parent 64ef8b3 commit 5a974f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/threads.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4867,12 +4867,12 @@
48674867
atomic<shared_ptr<node>> head;
48684868

48694869
public:
4870-
auto find(T t) const {
4870+
shared_ptr<node> find(T t) const {
48714871
auto p = head.load();
48724872
while (p && p->t != t)
48734873
p = p->next;
48744874

4875-
return shared_ptr<node>(move(p));
4875+
return p;
48764876
}
48774877

48784878
void push_front(T t) {

0 commit comments

Comments
 (0)