-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -68,4 +68,5 @@ | |
|
||
# Experimental | ||
|
||
- [BFD]() | ||
- [BFD]() | ||
- [5 things to not bother in C++](./advanced/useless.md) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 5 things to not bother in C++ | ||
|
||
## Pseudo destructors | ||
|
||
```cpp | ||
typedef int I; | ||
int main() { | ||
I x = 10; | ||
x.I::~I(); | ||
x = 20; | ||
} | ||
``` | ||
|
||
[Built-in member access operators(https://en.cppreference.com/w/cpp/language/operator_member_access#Built-in_member_access_operators) | ||
|
||
## ODR use | ||
|
||
ODR use _something_ [so question](https://stackoverflow.com/questions/19630570/what-does-it-mean-to-odr-use-something) | ||
|
||
```cpp | ||
struct F { | ||
static const int g_x = 2; | ||
}; | ||
|
||
int g_x_plus_1 = F::g_x + 1; // in this context, only the value of g_x is needed. | ||
// so it's OK without the definition of g_x | ||
|
||
vector<int> vi; | ||
vi.push_back( F::g_x ); // Error, this is odr-used, push_back(const int & t) expect | ||
// a const lvalue, so it's definition must be present | ||
``` |
This file contains 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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
add_executable(2070_rtc 2070-rtc-limit.c) | ||
|
||
if(UNIX AND NOT APPLE) | ||
add_executable(2070_rtc 2070-rtc-limit.c) | ||
endif() | ||
|
||
add_executable(scheduler scheduler.cpp) |
0d64990
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.
🎉 Published on https://cpp-by-example.netlify.app as production
🚀 Deployed on https://6743ae8d4c4a7d52dbc5befc--cpp-by-example.netlify.app