Skip to content

Commit

Permalink
⚔️ Updated some comments.
Browse files Browse the repository at this point in the history
Those are anecdotes about how I discovered things.
  • Loading branch information
rentruewang committed Sep 19, 2024
1 parent 8eb4143 commit 06061f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cpp/modern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ int main() {

// This should be UB.
function<int(void)> y{nullptr};

{
auto x{make_shared<int>(4)};
y = f(x);
}

cout << y() << endl;

// This is uninitialized.
Expand Down
3 changes: 2 additions & 1 deletion python/src/variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ def attack_and_defend(self) -> None:

def codependent_generic():
# Using generic to solve this.
# I think I noticed this is possible by reading the source code of spark.
# I think I noticed this is possible by first thinking how `typing.Self` is implemented,
# then expanded horizons by reading the source code of spark.
_B = TypeVar("_B", bound="B")
_A = TypeVar("_A", bound="A")

Expand Down

0 comments on commit 06061f3

Please sign in to comment.