01:40The ONLY C keyword with no C++ equivalent
From the creator
C has "restrict" but C++ does not. The restrict keyword in C is the only keyword that has no analogue in C++. The keyword promises to the compiler that objects accessible through the pointer will not be accessed (either read or written to) through any other means than through the restrict pointer. This promise to the compiler allows more potential optimizations, including removing redundant reads and potentially allowing automatic vectorization, which can lead to smaller and faster code. However, if you use it incorrectly, restrict can be the source of some seriously hard to find bugs because they may only appear at high optimization levels and not in your testing or debugging builds. Major C++ compilers do support restrict in a non-standardized way though, so if you are willing to write code that is specific to your compiler, then you may still be able to take advantage of restrict even though it is not part of standard C++. Erratum: In the fib_upto_n example the check for n==0 should go before the write to dst[0], and the check for n==1 should go before the write to dst[1], it is fixed in the GitHub link. I'm very confused why I ever wrote it that way, but that's what I get for not writing tests :). This did not affect anything in the video because I was using n=10. ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode Compiler explorer: https://godbolt.org/z/4EzvTGcfo restrict keyword: https://en.cppreference.com/w
Published 2021-08-14 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
01:40
19:55Announcing General Availability of Azure Bot Service and Language Understanding service
Microsoft Developer
57:29
09:02
18:59
12:24How to provisioning IoT devices at scale with IoT Hub Device Provisioning Service
Microsoft Developer
14:41TWC9: Connect(); On-Demand, Dev’s Guide to Azure, Future Workspace, Furby Hacking and more...
Microsoft Developer