Skip to content

Commit a70309c

Browse files
Sebastien PonceSebastien Ponce
Sebastien Ponce
authored and
Sebastien Ponce
committed
Used autogobble everywhere in minted by default
And dropped (most of) the manual gobble= in the rest of the slides this has also fixed a couple of bad indentations here and there
1 parent 1851121 commit a70309c

38 files changed

+206
-206
lines changed

talk/basicconcepts/classenum.tex

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
\center ``members'' grouped together under one name
77
\end{mdframed}
88
\begin{multicols}{2}
9-
\begin{cppcode*}{gobble=2}
9+
\begin{cppcode*}{}
1010
struct Individual {
1111
unsigned char age;
1212
float weight;
@@ -21,7 +21,7 @@
2121
};
2222
\end{cppcode*}
2323
\columnbreak
24-
\begin{cppcode*}{gobble=2,firstnumber=14}
24+
\begin{cppcode*}{firstnumber=14}
2525
Individual *ptr = &student;
2626
ptr->age = 25;
2727
// same as: (*ptr).age = 25;
@@ -56,7 +56,7 @@
5656
\center ``members'' packed together at same memory location
5757
\end{mdframed}
5858
\begin{multicols}{2}
59-
\begin{cppcode*}{gobble=2}
59+
\begin{cppcode*}{}
6060
union Duration {
6161
int seconds;
6262
short hours;
@@ -104,7 +104,7 @@
104104
\end{itemize}
105105
\end{block}
106106
\begin{multicols}{2}
107-
\begin{cppcode*}{gobble=2}
107+
\begin{cppcode*}{}
108108
enum VehicleType {
109109

110110
BIKE, // 0
@@ -114,7 +114,7 @@
114114
VehicleType t = CAR;
115115
\end{cppcode*}
116116
\columnbreak
117-
\begin{cppcode*}{gobble=2,firstnumber=8}
117+
\begin{cppcode*}{firstnumber=8}
118118
enum VehicleType
119119
: int { // C++11
120120
BIKE = 3,
@@ -158,7 +158,7 @@
158158
\begin{frame}[fragile]
159159
\frametitlecpp[98]{More sensible example}
160160
\begin{multicols}{2}
161-
\begin{cppcode*}{gobble=2}
161+
\begin{cppcode*}{}
162162
enum class ShapeType {
163163
Circle,
164164
Rectangle
@@ -171,7 +171,7 @@
171171
\end{cppcode*}
172172
\columnbreak
173173
\pause
174-
\begin{cppcode*}{gobble=2,firstnumber=10}
174+
\begin{cppcode*}{firstnumber=10}
175175
struct Shape {
176176
ShapeType type;
177177
union {
@@ -183,15 +183,15 @@
183183
\end{multicols}
184184
\pause
185185
\begin{multicols}{2}
186-
\begin{cppcode*}{gobble=2,firstnumber=17}
186+
\begin{cppcode*}{firstnumber=17}
187187
Shape s;
188188
s.type =
189189
ShapeType::Circle;
190190
s.radius = 3.4;
191191

192192
\end{cppcode*}
193193
\columnbreak
194-
\begin{cppcode*}{gobble=2,firstnumber=20}
194+
\begin{cppcode*}{firstnumber=20}
195195
Shape t;
196196
t.type =
197197
Shapetype::Rectangle;
@@ -205,14 +205,14 @@
205205
\frametitle{typedef and using \hfill \cpp98 / \cpp11}
206206
Used to create type aliases
207207
\begin{alertblock}{\cpp98}
208-
\begin{cppcode*}{gobble=2}
208+
\begin{cppcode*}{}
209209
typedef std::uint64_t myint;
210210
myint count = 17;
211211
typedef float position[3];
212212
\end{cppcode*}
213213
\end{alertblock}
214214
\begin{exampleblock}{\cpp11}
215-
\begin{cppcode*}{gobble=2,firstnumber=4}
215+
\begin{cppcode*}{firstnumber=4}
216216
using myint = std::uint64_t;
217217
myint count = 17;
218218
using position = float[3];

talk/basicconcepts/control.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
\begin{frame}[fragile]
7878
\frametitlecpp[98]{Control structures: switch}
7979
\begin{block}{Syntax}
80-
\begin{cppcode*}{gobble=0}
80+
\begin{cppcode*}{}
8181
switch(identifier) {
8282
case c1 : statements1; break;
8383
case c2 : statements2; break;

talk/basicconcepts/coresyntax.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
\item Custom conversion and promotion rules
170170
\end{itemize}
171171
\end{block}
172-
\begin{cppcode*}{gobble=4}
172+
\begin{cppcode*}{}
173173
#include <stdfloat> // may define these:
174174

175175
std::float16_t = 3.14f16; // 16 (1+5+10) bit float

talk/basicconcepts/functions.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
\begin{frame}[fragile]
44
\frametitlecpp[98]{Functions}
55
\begin{multicols}{2}
6-
\begin{cppcode*}{gobble=2}
6+
\begin{cppcode*}{}
77
// with return type
88
int square(int a) {
99
return a * a;
@@ -16,7 +16,7 @@
1616
}
1717
\end{cppcode*}
1818
\columnbreak
19-
\begin{cppcode*}{gobble=2,firstnumber=11}
19+
\begin{cppcode*}{firstnumber=11}
2020
// no return
2121
void log(char* msg) {
2222
std::cout << msg;
@@ -43,7 +43,7 @@
4343
\begin{frame}[fragile]
4444
\frametitlecpp[98]{Function default arguments}
4545
\begin{multicols}{2}
46-
\begin{cppcode*}{gobble=2}
46+
\begin{cppcode*}{}
4747
// must be the trailing
4848
// argument
4949
int add(int a,
@@ -55,7 +55,7 @@
5555

5656
\end{cppcode*}
5757
\columnbreak
58-
\begin{cppcode*}{gobble=2,firstnumber=11}
58+
\begin{cppcode*}{firstnumber=11}
5959
// multiple default
6060
// arguments are possible
6161
int add(int a = 2,
@@ -361,7 +361,7 @@
361361
\end{itemize}
362362
\end{block}
363363
\begin{exampleblock}{}
364-
\begin{cppcode*}{gobble=6}
364+
\begin{cppcode*}{}
365365
int sum(int b); // 1
366366
int sum(int b, int c); // 2, ok, overload
367367
// float sum(int b, int c); // disallowed
@@ -399,7 +399,7 @@
399399
\end{itemize}
400400
\end{goodpractice}
401401
\begin{exampleblock}{Example: Good}
402-
\begin{cppcode*}{gobble=2}
402+
\begin{cppcode*}{}
403403
/// Count number of dilepton events in data.
404404
/// \param d Dataset to search.
405405
unsigned int countDileptons(Data &d) {
@@ -413,7 +413,7 @@
413413
\begin{onlyenv}<2->
414414
\begin{alertblock}{Example: don't! Everything in one long function}
415415
\begin{multicols}{2}
416-
\begin{cppcode*}{gobble=6}
416+
\begin{cppcode*}{}
417417
unsigned int runJob() {
418418
// Step 1: data
419419
Data data;
@@ -430,7 +430,7 @@
430430
for (....) {
431431
\end{cppcode*}
432432
\columnbreak
433-
\begin{cppcode*}{gobble=6,firstnumber=last}
433+
\begin{cppcode*}{firstnumber=last}
434434
if (...) {
435435
data.erase(...);
436436
}

talk/basicconcepts/references.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
\end{block}
1212

1313
\begin{exampleblock}{Example:}
14-
\begin{cppcode*}{gobble=2}
14+
\begin{cppcode*}{}
1515
int i = 2;
1616
int &iref = i; // access to i
1717
iref = 3; // i is now 3

talk/basicconcepts/scopesnamespaces.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
\item They can be embedded to create hierarchies (separator is '::')
123123
\end{itemize}
124124
\begin{multicols}{2}
125-
\begin{cppcode*}{gobble=2}
125+
\begin{cppcode*}{}
126126
int a;
127127
namespace n {
128128
int a; // no clash
@@ -138,7 +138,7 @@
138138
}
139139
\end{cppcode*}
140140
\columnbreak
141-
\begin{cppcode*}{gobble=2,firstnumber=14}
141+
\begin{cppcode*}{firstnumber=14}
142142
namespace p { // reopen p
143143
void f() {
144144
p::a = 6;
@@ -207,7 +207,7 @@
207207
\end{itemize}
208208
\end{block}
209209
\begin{alertblock}{Supersedes static}
210-
\begin{cppcode*}{gobble=2,firstnumber=4}
210+
\begin{cppcode*}{firstnumber=4}
211211
static int localVar; // equivalent C code
212212
\end{cppcode*}
213213
\end{alertblock}
@@ -226,7 +226,7 @@
226226
\end{cppcode*}
227227
\end{alertblock}
228228
\begin{alertblock}{Never use in headers at global scope!}
229-
\begin{cppcode*}{gobble=2}
229+
\begin{cppcode*}{}
230230
#include "PoorlyWritten.h" // using namespace std;
231231
struct array { ... };
232232
array a; // Error: name clash with std::array

talk/concurrency/atomic.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
\end{itemize}
9797
\end{block}
9898
\begin{exampleblock}{}
99-
\begin{cppcode*}{gobble=2}
99+
\begin{cppcode*}{}
100100
int a{0};
101101
std::thread t1([&]{ std::atomic_ref<int> r{a}; r++;});
102102
std::thread t2([&]{ std::atomic_ref{a}++; });
@@ -106,7 +106,7 @@
106106
\end{cppcode*}
107107
\end{exampleblock}
108108
\begin{alertblock}{Don't mix concurrent atomic and non-atomic access}
109-
\begin{cppcode*}{gobble=2}
109+
\begin{cppcode*}{}
110110
std::thread t3([&]{ std::atomic_ref{a}++; });
111111
a += 2; // data race
112112
t3.join();

talk/concurrency/condition.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
\end{overprint}
8282

8383
\begin{alertblock}{Na\"ive waiting}
84-
\begin{cppcode*}{gobble=2,highlightlines=3}
84+
\begin{cppcode*}{highlightlines=3}
8585
auto processData = [&](){
8686
std::unique_lock<std::mutex> lock{mutex};
8787
cond.wait(lock, [&](){ return data.isReady(); });
@@ -101,7 +101,7 @@
101101
\end{block}
102102

103103
\begin{exampleblock}{Correct waiting}
104-
\begin{cppcode*}{gobble=2}
104+
\begin{cppcode*}{}
105105
auto processData = [&](){
106106
{
107107
std::unique_lock<std::mutex> lock{mutex};

talk/concurrency/mutexes.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
\end{itemize}
127127
\end{goodpractice}
128128
\begin{exampleblock}{}
129-
\begin{cppcode*}{gobble=2}
129+
\begin{cppcode*}{}
130130
void function(...) {
131131
// uncritical work ...
132132
{
@@ -210,7 +210,7 @@
210210
\end{itemize}
211211
\end{block}
212212
\begin{exampleblock}{}
213-
\begin{cppcode*}{gobble=2}
213+
\begin{cppcode*}{}
214214
Data data; std::shared_mutex mutex;
215215
auto reader = [&](){
216216
std::shared_lock lock{mutex};
@@ -236,7 +236,7 @@
236236
\end{itemize}
237237
\end{block}
238238
\begin{exampleblock}{}
239-
\begin{cppcode*}{gobble=2}
239+
\begin{cppcode*}{}
240240
void worker(const int id, std::ostream & os);
241241
void func() {
242242
std::osyncstream synccout1{std::cout};

talk/concurrency/threadsasync.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
\end{block}
1212

1313
\begin{exampleblock}{Example code}
14-
\begin{cppcode*}{gobble=2}
14+
\begin{cppcode*}{}
1515
void foo() {...}
1616
void bar() {...}
1717
int main() {
@@ -59,7 +59,7 @@
5959
\end{goodpractice}
6060

6161
\begin{exampleblock}{Example with jthread}
62-
\begin{cppcode*}{gobble=2}
62+
\begin{cppcode*}{}
6363
void foo() {...}
6464
void bar() {...}
6565
int main() {

0 commit comments

Comments
 (0)