mirror of
https://github.com/Noratrieb/womangling.git
synced 2026-03-14 21:36:06 +01:00
lesson 2 and fixes
This commit is contained in:
parent
6eb3332c34
commit
a6a7cbf6fa
5 changed files with 229 additions and 20 deletions
|
|
@ -15,7 +15,7 @@
|
|||
<h2>Lesson 1: Basics</h2>
|
||||
<noscript>
|
||||
<p>
|
||||
Warning: You have JavaScript disabled While the content is still
|
||||
Warning: You have JavaScript disabled. While the content is still
|
||||
viewable, interactive exercises will not work. Consider enabling
|
||||
JavaScript for this website.
|
||||
</p>
|
||||
|
|
@ -52,8 +52,7 @@ void f() {}
|
|||
</p>
|
||||
<p>
|
||||
We will see the <code>v</code> function type a lot in the rest of
|
||||
this guide. It stands for a function that takes no arguments and
|
||||
returns <code>void</code>.
|
||||
this guide. It stands for a function that takes no arguments.
|
||||
</p>
|
||||
<div class="quiz-section">
|
||||
<p>
|
||||
|
|
@ -129,10 +128,11 @@ void meow() {}
|
|||
</p>
|
||||
<p>
|
||||
Nested names start with an <code>N</code> and end with an
|
||||
<code>E</code>. Between those two letters, the hierarchy of the
|
||||
namespace is represented by putting on namespace name after another,
|
||||
with the function name last. Every name has the leading length and
|
||||
then the name itself, just like with global names.
|
||||
<code>E</code> (the <code>E</code> stands for "end" and is commonly
|
||||
used to end sequences). Between those two letters, the hierarchy of
|
||||
the namespace is represented by putting on namespace name after
|
||||
another, with the function name last. Every name has the leading
|
||||
length and then the name itself, just like with global names.
|
||||
</p>
|
||||
<pre class="code">
|
||||
namespace outer {
|
||||
|
|
@ -168,7 +168,7 @@ namespace a {
|
|||
</pre>
|
||||
<p>
|
||||
This function will mangle as <code>_ZN1a1b1c5innerEv</code>. We get
|
||||
all the concatinated names as <code>1a1b1c5inner</code>, with the
|
||||
all the concatenated names as <code>1a1b1c5inner</code>, with the
|
||||
previously mentioned characters around them.
|
||||
</p>
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ namespace cats {
|
|||
with information, so feel free to take a break and let the previous
|
||||
knowledge sink in.
|
||||
</p>
|
||||
<p>
|
||||
<p class="lesson-last-paragraph">
|
||||
If you want to try out more code and look at its mangling, I
|
||||
recommend using Compiler Explorer on
|
||||
<a href="https://godbolt.org">godbolt.org</a>. Under "Output", you
|
||||
|
|
@ -219,7 +219,7 @@ namespace cats {
|
|||
</p>
|
||||
<div class="center">
|
||||
<a href="lesson-2.html" class="action-button">
|
||||
Lesson 2: something that has not been written yet.
|
||||
Lesson 2: Arguments
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue