forked from LearningInfiniTensor/learning-cxx
-
Notifications
You must be signed in to change notification settings - Fork 439
learn-cxx #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Xiaobanli-new
wants to merge
32
commits into
InfiniTensor:main
Choose a base branch
from
Xiaobanli-new:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
learn-cxx #81
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
959c7bd
习题00已完成
Xiaobanli-new ae82754
习题1已完成
Xiaobanli-new 5980cc1
习题1和2已完成
Xiaobanli-new 15bdc96
习题3已完成
Xiaobanli-new 9dbbeee
习题4已完成
Xiaobanli-new 3c81a50
习题5已完成
Xiaobanli-new 6538576
习题6已完成
Xiaobanli-new 753031a
习题7已完成
Xiaobanli-new 481bf99
习题8已完成
Xiaobanli-new a83eae9
习题9已完成
Xiaobanli-new 56ed9b8
习题10已完成
Xiaobanli-new a1ee98a
习题11已完成
Xiaobanli-new 4ea4a74
习题12已提交
Xiaobanli-new 7e742b5
习题13已完成
Xiaobanli-new 919b83a
习题14已完成
Xiaobanli-new 248544b
习题15已完成
Xiaobanli-new 013405f
习题16已完成
Xiaobanli-new 096882d
习题17已完成
Xiaobanli-new 737fad3
习题18已完成
Xiaobanli-new 131e93b
习题19已完成
Xiaobanli-new 086903d
习题20已完成
Xiaobanli-new 2e6d017
习题22已提交
Xiaobanli-new 05a2a02
习题22已完成
Xiaobanli-new 102c521
习题23已完成
Xiaobanli-new 04e5393
习题24已提交
Xiaobanli-new 629cb22
习题25已完成
Xiaobanli-new d802b0a
习题26已完成
Xiaobanli-new 90e6d7a
习题27、28已完成
Xiaobanli-new 9ac73a5
习题29已完成
Xiaobanli-new 108fc2e
习题30已完成
Xiaobanli-new cf8a352
30修改
Xiaobanli-new 629e1bc
习题31-33已完成
Xiaobanli-new File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ ColorEnum convert_by_pun(Color c) { | |
|
|
||
| TypePun pun; | ||
| // TODO: 补全类型双关转换 | ||
|
|
||
| pun.c = c; | ||
| return pun.e; | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy constructor allocates an array with size
other.cachedinstead of the original capacity. This creates a subtle bug: if the copied object later needs to compute Fibonacci numbers beyond thecachedindex, it will cause a buffer overflow. For example, if the original object was constructed with capacity 12 but has only computed up to index 5 (cached=6), the copy would only allocate 6 elements. If the copy then tries to compute index 10, it would overflow. While the current test doesn't expose this bug (since the copy is const and doesn't compute new values), this is incorrect design. The capacity should be tracked as a member variable and preserved during copying.