@@ -142,11 +142,9 @@ This is what our `fragments.h` file should look like:
142
142
#include <vector>
143
143
#include <string>
144
144
145
- using Fragments = std::vector<std::string>;
145
+ std::vector<std::string> load_fragments (const std::string& filename) ;
146
146
147
- Fragments load_fragments (const std::string& filename);
148
-
149
- void fragment_statistics (const Fragments& fragments);
147
+ void fragment_statistics (const std::vector<std::string>& fragments);
150
148
151
149
void write_sequence (const std::string& filename, const std::string& sequence);
152
150
```
@@ -164,11 +162,9 @@ This is what our `fragments.h` file should look like:
164
162
#include <vector>
165
163
#include <string>
166
164
167
- using Fragments = std::vector<std::string>;
168
-
169
- Fragments load_fragments (const std::string& filename);
165
+ std::vector<std::string> load_fragments (const std::string& filename);
170
166
171
- void fragment_statistics (const Fragments & fragments);
167
+ void fragment_statistics (const std::vector<std::string> & fragments);
172
168
173
169
void write_sequence (const std::string& filename, const std::string& sequence);
174
170
```
@@ -192,11 +188,9 @@ This is what our `fragments.h` file should look like:
192
188
*#include <vector>
193
189
*#include <string>
194
190
195
- using Fragments = std::vector<std::string>;
191
+ std::vector<std::string> load_fragments (const std::string& filename) ;
196
192
197
- Fragments load_fragments (const std::string& filename);
198
-
199
- void fragment_statistics (const Fragments& fragments);
193
+ void fragment_statistics (const std::vector<std::string>& fragments);
200
194
201
195
void write_sequence (const std::string& filename, const std::string& sequence);
202
196
```
@@ -223,38 +217,9 @@ This is what our `fragments.h` file should look like:
223
217
#include <vector>
224
218
#include <string>
225
219
226
- *using Fragments = std::vector<std::string>;
227
-
228
- Fragments load_fragments (const std::string& filename);
229
-
230
- void fragment_statistics (const Fragments& fragments);
231
-
232
- void write_sequence (const std::string& filename, const std::string& sequence);
233
- ```
234
-
235
-
236
- .explain-bottom[
237
- We also include our type alias &ndash ; otherwise the compiler won't know what
238
- we mean by ` Fragments `
239
- ]
240
-
241
- ---
242
-
243
- # Splitting projects over multiple files
244
-
245
- This is what our ` fragments.h ` file should look like:
246
-
247
- ```
248
- #pragma once
249
-
250
- #include <vector>
251
- #include <string>
252
-
253
- using Fragments = std::vector<std::string>;
254
-
255
- *Fragments load_fragments (const std::string& filename);
220
+ *std::vector<std::string> load_fragments (const std::string& filename);
256
221
*
257
- *void fragment_statistics (const Fragments & fragments);
222
+ *void fragment_statistics (const std::vector<std::string> & fragments);
258
223
*
259
224
*void write_sequence (const std::string& filename, const std::string& sequence);
260
225
```
@@ -280,11 +245,11 @@ This is what our `fragments.cpp` file should look like:
280
245
281
246
#include "fragments.h"
282
247
283
- Fragments load_fragments (const std::string& filename)
248
+ std::vector<std::string> load_fragments (const std::string& filename)
284
249
{ ...
285
250
}
286
251
287
- void fragment_statistics (const Fragments & fragments)
252
+ void fragment_statistics (const std::vector<std::string> & fragments)
288
253
{ ...
289
254
}
290
255
@@ -306,11 +271,11 @@ This is what our `fragments.cpp` file should look like:
306
271
307
272
#include "fragments.h"
308
273
309
- Fragments load_fragments (const std::string& filename)
274
+ std::vector<std::string> load_fragments (const std::string& filename)
310
275
{ ...
311
276
}
312
277
313
- void fragment_statistics (const Fragments & fragments)
278
+ void fragment_statistics (const std::vector<std::string> & fragments)
314
279
{ ...
315
280
}
316
281
@@ -337,11 +302,11 @@ This is what our `fragments.cpp` file should look like:
337
302
338
303
*#include "fragments.h"
339
304
340
- Fragments load_fragments (const std::string& filename)
305
+ std::vector<std::string> load_fragments (const std::string& filename)
341
306
{ ...
342
307
}
343
308
344
- void fragment_statistics (const Fragments & fragments)
309
+ void fragment_statistics (const std::vector<std::string> & fragments)
345
310
{ ...
346
311
}
347
312
@@ -368,11 +333,11 @@ This is what our `fragments.cpp` file should look like:
368
333
369
334
#include "fragments.h"
370
335
371
- *Fragments load_fragments (const std::string& filename)
336
+ *std::vector<std::string> load_fragments (const std::string& filename)
372
337
*{ ...
373
338
*}
374
339
*
375
- *void fragment_statistics (const Fragments & fragments)
340
+ *void fragment_statistics (const std::vector<std::string> & fragments)
376
341
*{ ...
377
342
*}
378
343
*
@@ -1851,7 +1816,7 @@ Exercise: add a function to your code to:
1851
1816
# Possible solution
1852
1817
1853
1818
```
1854
- std::string extract_longest_fragment (Fragments & fragments)
1819
+ std::string extract_longest_fragment (std::vector<std::string> & fragments)
1855
1820
{
1856
1821
unsigned int size_of_longest = 0;
1857
1822
unsigned int index_of_longest = 0;
0 commit comments