Skip to content

Commit ad93f8d

Browse files
committed
[T.84] make List::front example compile
closes #2231
1 parent cb0744e commit ad93f8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CppCoreGuidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <a name="main"></a>C++ Core Guidelines
22

3-
May 8, 2025
3+
Jul 8, 2025
44

55
Editors:
66

@@ -18753,7 +18753,7 @@ It could be a base class:
1875318753
class List : List_base {
1875418754
public:
1875518755
void put_front(const T& e) { add_front(new Link<T>{e}); } // implicit cast to Link_base
18756-
T& front() { static_cast<Link<T>*>(first).val; } // explicit cast back to Link<T>
18756+
T& front() { return static_cast<Link<T>*>(first)->val; } // explicit cast back to Link<T>
1875718757
// ...
1875818758
};
1875918759

0 commit comments

Comments
 (0)